public class MainClass {
public static void main(String[] args) {
MyClass f = new MyClass("A", 19);
System.out.println(f);
}
}
class MyClass {
int shoeSize;
String nickName;
MyClass(String nickName, int shoeSize) {
this.shoeSize = shoeSize;
this.nickName = nickName;
}
public String toString() {
return ("Call me " + nickName + ". My shoe size is " + shoeSize);
}
}
Call me A. My shoe size is 19