Search This Blog

save java programs with".java" extension

examples :

helloworld.java
sample.java
match.java
send-mail.java

quick links

"this" keyword program1 in java

class thisdemo1
{
int a=100,b=200;
void funa()
{
int a=10;
int b=20;
System.out.println("local a:"+a);
System.out.println("local b :"+b);
System.out.println("global a :"+this.a);
System.out.println("global b :"+this.b);

}
public static void main(String args[])
{
thisdemo1 t=new thisdemo1();
t.funa();
}
}

===============================================
output :

local a:10
local b:20
global a:100
global b:200