Hi All,
Bellow i'm writing one small programe,
public class TrickyOne {
TrickyOne to = new TrickyOne("welcome");
TrickyOne(
String a){
this.localvariable = a;
}
private String localvariable;
/**
* @return the localvariable
*/
public String getLocalvariable() {
return localvariable;
}
/**
* @param localvariable the localvariable to set
*/
public void setLocalvariable(String localvariable) {
this.localvariable = localvariable;
}
public static void main(String args[]) {
TrickyOne to = new TrickyOne("welcome");
System.out.println(to);
}
}
When your displaying 'TrickyOne object(to) ,Is it possible to display welcome.Should not do any chnages inside main method.
Thanks & Regards,
Sijesh