Monday, January 4, 2010
InnerClass
Final method-local variables are accessible to method-local inner classes while non-final method-local variables are not accessible to the same.
No clue!!!
Let the bit-representation of 'a' be
1111 1111 1111 1111 1011 1010 1101 0111.
What will be the result of
(short) a >> 3
ANS: 1110 0111 0101 1010
1111 1111 1111 1111 1011 1010 1101 0111.
What will be the result of
(short) a >> 3
ANS: 1110 0111 0101 1010
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;
}
}
{
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
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! :)
Monday, February 12, 2007
Testing EMail Blog Publishing
Hello Everybody,
Long time no entry!!! :) Anyway, today is for
testing blogging via email.
See ya!!!
Subscribe to:
Posts (Atom)