+2

I have created an array of objects but on printing it will give me reference values of objects rather then variable of objects?

2/21/2020 5:31:55 PM

Muhammad Bilal

7 Answers

New Answer

+3

You need to print System.out.println(s.student_id ); System.out.println(s.student_marks)

+3

Thanks alot

+2

You have to override the toString() method and then call the toString() on the student object.

+1

Share your code please.

+1

Can you share your so that someone can see what you have done and correct the mistakes

+1

https://code.sololearn.com/cfCidEAIZsdL/?ref=app

+1

This is how you should do it in order to print objects of a class. https://code.sololearn.com/cTAlj0Gk1Gb7/?ref=app