-1
List<String> info = Arrays.asList(name,company,price,destination,password);
System.out.println(info);

I'm making a program to take in these String and I need them in a list but don't wanna add:

info.add(name);

for every single one that way in the future I can do the same without having this issue. When I run it I get this error:

List<String> info = Arrays.asList(name,company,price,destination,password);
        ^
  symbol:   class List
  location: class main
1 error
error: compilation failed

Anyone have a fix?

1 Answers1

-1

did you import this packages from java.util ?

import java.util.Arrays;
import java.util.List;
Otti
  • 1