Tuesday, September 8, 2009

One Object can access a private variable of another object of the same class

class ClassPrivateAccessTest
{
private int i;

ClassPrivateAccessTest(int j)
{
i = j;
}

public static void main(String[] args)
{
ClassPrivateAccessTest obj1 = new ClassPrivateAccessTest(5);
ClassPrivateAccessTest obj2 = new ClassPrivateAccessTest(7);

obj1.print();
obj2.print();

System.out.println(obj1.sum(obj2) + "!");
}


void print()
{
System.out.println(i + " ");
}


int sum(ClassPrivateAccessTest obj)
{
return this.i + obj.i;
}
}

Thursday, April 16, 2009

Myanmar Version!

ၿမန္မာလို စမ္းႀကည္.တာ။

Sunday, April 12, 2009

Boring Day

Do I need courage to get my job done? What if I am not interested in my job when I really work? Quite scary that it would be the case. No no. Let me have the motivation to try hard! :)