🌐
W3Schools
w3schools.com › java › java_strings.asp
Java Strings
Java Wrapper Classes Java Generics Java Annotations Java RegEx Java Threads Java Lambda Java Advanced Sorting ... How Tos Add Two Numbers Swap Two Variables Even or Odd Number Reverse a Number Positive or Negative Square Root Area of Rectangle Celsius to Fahrenheit Sum of Digits Check Armstrong Num Random Number Count Words Count Vowels in a String Remove Vowels Count Digits in a String Reverse a String Palindrome Check Check Anagram Convert String to Array Remove Whitespace Count Character Frequency Sum of Array Elements Find Array Average Sort an Array Find Smallest Element Find Largest Element Second Largest Array Min and Max Array Merge Two Arrays Remove Duplicates Find Duplicates Shuffle an Array Factorial of a Number Fibonacci Sequence Find GCD Check Prime Number ArrayList Loop HashMap Loop Loop Through an Enum
🌐
GeeksforGeeks
geeksforgeeks.org › java › strings-in-java
Java Strings - GeeksforGeeks
Syntax: // Method 1 String str= "geeks"; // Method 2 String str= new String("geeks"); StringBuffer is a peer class of String, it is mutable in nature and it is thread safe class , we can use it when we have multi threaded environment and shared ...
Published   February 12, 2019
🌐
W3Schools
w3schools.com › java › java_ref_string.asp
Java String Reference
Java Wrapper Classes Java Generics Java Annotations Java RegEx Java Threads Java Lambda Java Advanced Sorting ... How Tos Add Two Numbers Swap Two Variables Even or Odd Number Reverse a Number Positive or Negative Square Root Area of Rectangle Celsius to Fahrenheit Sum of Digits Check Armstrong Num Random Number Count Words Count Vowels in a String Remove Vowels Count Digits in a String Reverse a String Palindrome Check Check Anagram Convert String to Array Remove Whitespace Count Character Frequency Sum of Array Elements Find Array Average Sort an Array Find Smallest Element Find Largest Element Second Largest Array Min and Max Array Merge Two Arrays Remove Duplicates Find Duplicates Shuffle an Array Factorial of a Number Fibonacci Sequence Find GCD Check Prime Number ArrayList Loop HashMap Loop Loop Through an Enum
🌐
GeeksforGeeks
geeksforgeeks.org › java › initializing-a-list-in-java
Initializing a List in Java - GeeksforGeeks
List<String> colors = Arrays.asList("Red", "Green", "Blue"); If we want to create the mutable List. We can use the syntax mentioned below using Arrays.asList() method. List<Integer> list=new ArrayList<>(Arrays.asList(1, 2, 3)); Java 9 introduced List.of() method which takes in any number of arguments and constructs a compact and unmodifiable list out of them.
Published   October 11, 2025
🌐
Sentry
sentry.io › sentry answers › java › how do i initialize a `list` object in java?
How do I initialize a `List<String>` object in Java?
import java.util.List; public class Main { public static void main(String[] args) { List<String> myList = List.of("Apple", "Banana", "Cherry"); System.out.println("My List: " + myList); } } Lists created with the List.of() method are immutable, meaning you cannot add, remove, or modify list elements after initialization. Sentry BlogException Handling in Java (with Real Examples) (opens in a new tab) Syntax.fmListen to the Syntax Podcast (opens in a new tab) Listen to the Syntax Podcast (opens in a new tab) Tasty treats for web developers brought to you by Sentry.
🌐
Edureka
edureka.co › blog › java-string
Java Strings - How to Declare String in Java With Examples
February 13, 2025 - Java String ValueOf(): This method ... you can convert int to string, long to string, Boolean to string, character to string, float to string, double to string, object to string and char array to string....
🌐
Alvin Alexander
alvinalexander.com › java › java-string-array-reference-java-5-for-loop-syntax
Java String array examples (with Java 5 for loop syntax) | alvinalexander.com
Here’s a complete source code example that demonstrates the syntax prior to Java 5: public class JavaStringArrayTests1 { private String[] toppings = {"Cheese", "Pepperoni", "Black Olives"}; // our constructor; print out the String array here public JavaStringArrayTests1() { // old `for` loop int size = toppings.length; for (int i=0; i<size; i++) { System.out.println(toppings[i]); } } // main kicks everything off.
🌐
Processing
processing.github.io › processing-javadocs › core › processing › data › StringList.html
StringList
Functions like sort() and shuffle() always act on the list itself. To get a sorted copy, use list.copy().sort(). ... Construct a StringList from a random pile of objects. Null values will stay null, but all the others will be converted to String values. public StringList(java.lang.Iterable<java.lang.String> iter)
Find elsewhere
🌐
DataFlair
data-flair.training › blogs › java-string-methods-and-constructor
Java String (Methods & Constructor) with Syntax and Example - DataFlair
May 12, 2024 - The strings in java are a collection ... cannot be changed.String can also be listed as an array of characters starting at the index 0 and ending with a null character (\0)....
🌐
GeeksforGeeks
geeksforgeeks.org › java › java-string-methods
Java String Methods - GeeksforGeeks
October 11, 2025 - This method returns the index within the string of the first occurrence of the specified string.
🌐
Software Testing Help
softwaretestinghelp.com › home › java › java string methods tutorial with examples
Java String Methods Tutorial With Examples
April 1, 2025 - Answer: A String is a class in Java and it can be seen as a collection or the sequence of characters. Strings are used as an object in Java. ... Answer: Below is the program on how to get a list of Strings in Java.
🌐
Programiz
programiz.com › java-programming › string
Java String (With Examples)
In Java, a string is a sequence of characters. For example, "hello" is a string containing a sequence of characters 'h', 'e', 'l', 'l', and 'o'. In this tutorial, we will learn about strings in Java with the help of examples.
🌐
Medium
medium.com › @mgm06bm › java-string-collections-list-vs-array-choosing-the-right-option-57e14bc00466
Java String Collections: List vs. Array —Understanding Their Differences | Mehmood | Medium
January 4, 2024 - import java.util.List; List<String> listOfString = new ArrayList<>(); listOfString.add("Java"); listOfString.add("List"); listOfString.remove(0); system.out.println(listOfString); //[List]
🌐
Oracle
docs.oracle.com › javase › tutorial › java › data › strings.html
Strings (The Java™ Tutorials > Learning the Java Language > Numbers and Strings)
For each object that is not a String, its toString() method is called to convert it to a String. Note: The Java programming language does not permit literal strings to span lines in source files, so you must use the + concatenation operator at the end of each line in a multi-line string.
Top answer
1 of 12
892

If you check the API for List you'll notice it says:

Interface List<E>

Being an interface means it cannot be instantiated (no new List() is possible).

If you check that link, you'll find some classes that implement List:

All Known Implementing Classes:

AbstractList, AbstractSequentialList, ArrayList, AttributeList, CopyOnWriteArrayList, LinkedList, RoleList, RoleUnresolvedList, Stack, Vector

Some of those can be instantiated (the ones that are not defined as abstract class). Use their links to know more about them, I.E: to know which fits better your needs.

The 3 most commonly used ones probably are:

 List<String> supplierNames1 = new ArrayList<String>();
 List<String> supplierNames2 = new LinkedList<String>();
 List<String> supplierNames3 = new Vector<String>();

Bonus:
You can also instantiate it with values, in an easier way, using the Arrays class, as follows:

List<String> supplierNames = Arrays.asList("sup1", "sup2", "sup3");
System.out.println(supplierNames.get(1));

But note you are not allowed to add more elements to that list, as it's fixed-size.

2 of 12
207

Can't instantiate an interface but there are few implementations:

JDK2

List<String> list = Arrays.asList("one", "two", "three");

JDK7

//diamond operator
List<String> list = new ArrayList<>();
list.add("one");
list.add("two");
list.add("three");

JDK8

List<String> list = Stream.of("one", "two", "three").collect(Collectors.toList());

JDK9

// creates immutable lists, so you can't modify such list 
List<String> immutableList = List.of("one", "two", "three");

// if we want mutable list we can copy content of immutable list 
// to mutable one for instance via copy-constructor (which creates shallow copy)
List<String> mutableList = new ArrayList<>(List.of("one", "two", "three"));

Plus there are lots of other ways supplied by other libraries like Guava.

List<String> list = Lists.newArrayList("one", "two", "three");
🌐
Tutorialspoint
tutorialspoint.com › home › java › java strings
Java - String Class
September 1, 2008 - The following are the built-in methods of the String class in Java with their syntaxes and usages −
🌐
Coderanch
coderanch.com › t › 502761 › java › List-String
List to String (Java in General forum at Coderanch)
list.get(index).toString() will convert any of the values to a String (whether that's useful will depend on what sort of objects they are).
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › lang › String.html
String (Java Platform SE 8 )
October 20, 2025 - The class String includes methods for examining individual characters of the sequence, for comparing strings, for searching strings, for extracting substrings, and for creating a copy of a string with all characters translated to uppercase or to lowercase. Case mapping is based on the Unicode Standard version specified by the Character class. The Java language provides special support for the string concatenation operator ( + ), and for conversion of other objects to strings.
🌐
Oracle
docs.oracle.com › en › java › javase › 11 › docs › api › java.base › java › lang › String.html
String (Java SE 11 & JDK 11 )
January 20, 2026 - The class String includes methods for examining individual characters of the sequence, for comparing strings, for searching strings, for extracting substrings, and for creating a copy of a string with all characters translated to uppercase or to lowercase. Case mapping is based on the Unicode Standard version specified by the Character class. The Java language provides special support for the string concatenation operator ( + ), and for conversion of other objects to strings.