current position:Home>Application of java object-oriented array

Application of java object-oriented array

2022-02-03 02:12:00 CSDN Q & A

The phenomenon and background of the problem

img

img

Operation results and error reporting contents

What memory address do I display

My solution ideas and tried methods
What I want to achieve



Refer to the answer 1:



Refer to the answer 2:



Refer to the answer 3:

If you print an object , The default is the memory address of the print object , If you want to display the contents of the object , Must be rewritten toString Method

public String toString(){      return " Object content ";}



Refer to the answer 4:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202030211583126.html

Random recommended