
how to write this in java

do u mean this key word... then when ever u want to represent d current class object. just like following..
class A
{
int a=10; //class parameter a
public void abc(int a) //passed parameter from main function a
{
System.out.println("a value of current class:"+this.a+"a value as an parameter"+a);
}
public static void main(String arg[])
{
abc(5);
}
}
the above program gives result as .......a value of current class:10 a value as an parameter 5......
why bcoz this.a represents class parameter and a represents passed parameter in this method.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.