class Main {public static void main(String[] args) {System.out.println(1);}void foo(){this=new Main();}}
Hi all,
The code that is given here gives out error that "value cannot be assigned to final variable.But see this code once
public class Main{
Main ob;
public static void main(String[] args)
{
System.out.println(1);
}
void foo(Main ob)
{
this.ob=new Main();
}
}
Here "this" is used to make global variables to be overriden by local variables thats it.And as per my knowledge it is keywrd rather than a variable.
Regards,
Lalitha