/**
* CallbyAddress obj = new CallbyAddress(); System.out.println(obj); Above print
* statement should print "Unikaihatsu"
*
*
*/
public class CallbyAddress {
/**
* overrides the toString() of Object class
*/
public String toString() {
return "Unikaihatsu";
}
/**
* displays the this.toString() message on console
*
*/
public static void display() {
System.out.println(new CallbyAddress());
}
/**
* execution begin from here
*
* @param args
* commandline arguments
*/
public static void main(String[] args) {
display();
}
}
No comments:
Post a Comment