0
Can you help me with my code?
Hello. đ I am learning OOP in Java and wrote a nice program (players in guilds and their managing), bit hit a tiny problem. I have a method, that should output "<PlayerName> has <Player's money>
quot; and printing name of of he player (object) doesn't work. The method uses "this" as Player's name. But instead of name of the object it outputs name of the class followed by "@" and a hexadecimal ID (e. g. Soldier@e29ba673d). I made an eaaier program with the same problem. It should output "Hi, I am Johny".3 Answers
+ 1
you must change to this:
https://code.sololearn.com/c46FOippU5sw/?ref=app
0
What should I change?
https://code.sololearn.com/cat8SwlNJoU3/?ref=app
0
Thank you. So I have to add a Name attribute. Doesn't exist any function that returns name of the object?