Is it in Java possible to store classes...
Class1 class1 = new Class1();
...in Arrays/ArrayLists, somehow like this:
ArrayList<> classArray = new ArrayList();
classArray.add(class1);
Obviously this doesn't work, but how could it work?
Of course you can. You just specify the type of objects you want to store when you create the array list:
ArrayList<Class1> classArray = ArrayList<Class1>();
classArray.add(class1);
If the class can only be Class1
ArrayList<Class1> list = new ArrayList<Class1>();
Above code won't allow any other class objects it can only store objects of type Class1
If you want to store any class object
ArrayList<Object> list = new ArrayList<Object>();
Object is a parent class of everything in java which is the reason why it can store object of any class
manager.beginTransaction().replace(R.id.fragment_one, new //ArrayList with Class//).commit(); ?
Classobjects than represent a class?Fragment1, which displays a fragment. I want to store that whole Fragment class in a List