explanation and code for java array of objects in netbeans

preview_player
Показать описание

In this tutorial i will be explaining program for how to create an array of objects in java in Netbeans ide. So this video contains explanation and code for java array of objects.

If we want to deal with large amount of data of same datatype then instead of declaring every single variable as variable0, variable1, variable2, etc we can rather declare an array of that datatype and store the data in it.

In java object is an instance of a class. Java supports encapsulation of data i.e. from class1 you cannot directly call a method of class2. For this you need to create an object of class2 and using that object you have to call that method of class2.

In this example,

We will be creating a class Student which will contain a String variable name and an Integer variable age.
We will then create an array of type Student.
Then we will create objects of class Student, store values in them and then store these objects in the array which we created.
so let us learn how to create an array of objects in java in netbeans.
Рекомендации по теме
Комментарии
Автор

only video on youtube which explains so well, thank you sir

letsdefine
Автор

please, would you tell me that how to find out the length of an "Array of Object" as the ".length" method is not working with it.. please clarify the doubt

murlimishra
join shbcf.ru