![]() ![]() This way you will be able to manage it better. I will suggest instead of using a 3D array, you shall create a Student Class that will hold all the information for a student and A Class for SchoolClass that will hold a list of students in the class and name of class and you can maintain an Array of SchoolClass to serve the purpose. Suggestion: Declare a class with three Strings create constructor with this three parameters and put getter and setters to get and set values via Objects NOTE: It's not recommended to use 3D array for this purpose. This is very tedious task in your case as you want to insert details at every position. Despite declaring variables one by one, like number1, number 2, or number3, you can directly declare an array to store all the sequential format variables. The condition that imparts on the array that all the variables are of the same data type. What is an Array The array is the data structure that stores data sequentially in a fixed size. means Three (4x2) 2 Dimensional ArraysĪt Start you can directly use int threeDArray = First, get a clear idea of the array, and further, we will learn the concept of the multidimensional 3D array in Java. In 3D array elements look like int arra圓D You can insert like this But you have so many elements. So when you insert School="A1" it means you have entered element at 0,0,0 position.įrom 0,0,0 this will move upto the position 1000,20,5. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |