Home > Back-end >  Of the new code as follows, from the output is blank
Of the new code as follows, from the output is blank

Time:02-17

To create screenshots of the parent class
Subclasses screenshot
Should be output according to the imagination, "I'm 19 years old, I am a adult, but the output result is blank

CodePudding user response:

Wait for to reassure yo ~ ~ ~

CodePudding user response:

Want System. In the console output, out. The println (new Human () getAge (19). The toString ());
In addition, the language coding standards, the set is the set values, the get is to obtain the value,

CodePudding user response:

reference line 2 floor day return reply:
want to console output, to System. Out. The println (new Human () getAge (19). The toString ());
Coding standards, in addition, the language set is the set values, the get is to obtain the value of

Are still a little don't quite understand, the parent class has changed the value of the age in the get method, then the tostring method is not this value should be used, then the output?
But I try the method you first, thank you very much

CodePudding user response:

reference line 2 floor day return reply:
want to console output, to System. Out. The println (new Human () getAge (19). The toString ());
Coding standards, in addition, the language set is the set values, the get is to obtain the value of

Still no good
  • Related