0
I want to create a Arraylist which should contain Integers and Strings.. Is that possible?
4 ответов
+ 2
But this is possible:
fruit.add("Apple");
fruit.add("12311");
+ 1
Its possible without inferring generics
var array = new ArrayList();
or
var array = new ArrayList<Object>();
also you can make an subimplementation to provide methods getting back with right values.... maybe with Optional class. Explore it!!
0
no it's not possible
0
var if it's java 10