[code]
class Outer{
public
String alpha="Instance Variable of Outer Class";
Outer(){} //works with any modifier public,private,protected
void Outer(String s){}
//Constructors can't be native, abstract, static, synchronized, or final:
class Inner{
void print(){
System.out.println(Outer.this.alpha);//-------------------(A)
}
}
//class Inner3 extends Inner{} cannot be possible
static class Inner4{ //works fine
public void method(){
Inner4 ref=new Inner4(); //can do only in static class methods -----------------(B)
}
}
//class static Inner4{} //does not--------------(C)
}
[code]
Question 1
plz expalin A,B,C correct me if i am wrong
Question 2
What type of Exception an Inner class can throw or may occur in Inner Class
Question no 3
[CODE]
class Outer{
class static Inner{}
}
How will you create an instance of static Inner Class? Select 2
a. Inner a= new Inner();
b. Outer o= new Outer();Outer.Inner a= new o.Inner();
c. Outer.Inner a= new Outer.new Inner();
d. Outer.Inner a= new Outer.Inner();
ANS is B,D but A also in a method of Static class???
[CODE]
Thanks in Advance