Hello I have question to my small program how I can print the value of p1
? When I am using p1.toString()
method this still shows me the address of an object I was searching in google some other ways and I still don't know how to do this. Here is the code:
public class Boss {
String name;
public Boss(String input) { // This is the constructor
name = "Our Boss is also known as : " + input;
}
public static void main(String args[]) {
Boss p1 = new Boss("Super-Man");
System.out.println(p1.toString());
}