Converting an object to a string
Converting an object to a string
Converting an object to a string
Background All Java objects have a toString() method, which is invoked when you try to print the object. System.out.println(myObject); // invokes myObject.toString() This method is defined in the Object class (the superclass of all Java objects). The Object.toString() method returns a fairly ugly looking string, composed of the name of the class, an @ symbol … Read more
If I understand the question correctly, you simply want to change your ToString() method to look like this: public override string ToString() { return string.Format(“Din totala summa är {0}{1}”, Name, GetScore()); } Now, that said, you probably have a number of other problems. It seems highly unlikely that the Arrows class should inherit the Player … Read more