Hi,if I have array of objects {first(name,age),second(name,age)}
How can I access first (name) in java
Thanks
kukuruku
0
Light Poster
Recommended Answers
Jump to PostIn the same way you access any element in any array:
// initializing the ARRAY: MyCustomClass [] array = new MyCustomClass[2]; // array is not null, but array[0], array[1] are null // array[0] is a MyCustomClass array[0] = new MyCustomClass(....); array[1] = new MyCustomClass(....); // array[i] are …
All 3 Replies
javaAddict
900
Nearly a Senior Poster
Team Colleague
Featured Poster
kukuruku
0
Light Poster
javaAddict
900
Nearly a Senior Poster
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.