You could create a list of Object like List<Object> list = new ArrayList<Object>() . As all classes implementation extends implicit or explicit from java. lang. Object class, this list can hold any object, including instances of Employee , Integer , String etc.
Read moreCan you have a list of objects in Java?
A list in Java is a sequence of elements according to an order. The List interface of java. util package is the one that implements this sequence of objects ordered in a particular fashion called List .
Read moreWhat is an object list in Java?
The List interface in Java provides a way to store the ordered collection. It is a child interface of Collection. It is an ordered collection of objects in which duplicate values can be stored . Since List preserves the insertion order, it allows positional access and insertion of elements.10 Şub 2022
Read moreWhat is an object in a list?
In category theory, an abstract branch of mathematics, and in its applications to logic and theoretical computer science, a list object is an abstract definition of a list, that is, a finite ordered sequence .
Read more