Sunday, 2 February 2014

Java coding questions

1. What would be the output of the below code....

public static void main(String[] args)
{
int i=0;
Integer wrapperInt=null;
i=wrapperInt;
System.out.println(i);
}
Please reply If you know you can reply... if not you can ask me...


2.Why we use this keyword in below code...

public class Demo{
private int a;
private int b;

Demo(int a,int b)
{
this.a=a;
this.b=b
}
}

Why we used this.a and this.b ?

No comments:

Post a Comment