Archive

Archive for the ‘java fun’ Category

fun with Java – for beginners

May 28, 2006 Saj 1 comment

Ok. I am back after a short long break ;-) .

This time I am going to post a simple java programme. If you are a beginner in java you are invited to answer the output. Condition is you have to tell the answer with out compiling the code . Here we go..

class Test
{

int num1 = 20;
int num3 = getNumber();
int num2 = 30;
int getNumber()
{
return num2;
}
public static void main(String[] args)
{
Test t = new Test();
System.out.println(t.num3);
}
}