+ 1
How to create multiple object in Java for student class in Java?
3 Answers
+ 3
student a = new student();
student b = new student();
...
+ 2
Student maria = new Student ();
maria.setAge (27);
maria.setName ("Maria");
Student dana = new Student ();
dana.setName (29);
dana.setName("Dana");
You have to define your purpose of creating objects. You may want to create them and store them in a list/array.
List <Student> stdentList = new ArrayList <Student>();
studentList.add (maria);
studentList.add (dana);
0
Student student1 = new Student();
Student student2 = new Student();
And you can keep doing this for as many as you require.