+ 1
If Arraylist cannot store elements ,how does string get passed into the Arraylist.
There's a yellow box that says ArrayList holds types of objects only and hence we need to pass in objects instead of elements. String being a data type ,how does it get passed into an ArrayList.
2 Réponses
+ 2
first of all you can pass String to arraylist because String is not primitive data type.char is.
but for other data type like int or byte see this.
https://www.sololearn.com/learn/432/?ref=app
+ 1
Thank you shobhit