Arraylist list=new Arraylist();
How is it possible while we pass class in Arraylist and string is not class how can we pass string in Arraylist?
Generic classes
@KirtiGupta here is a excerpt from java official docs.
The Java platform provides the String
class to create and manipulate strings.
String is a class in java, you can make an object of String like any other.
If your query is resolved mark it resolved and rate full!