Home arrow static arrow Java Programming [Archive] - Problem instantiating static nested class
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - Problem instantiating static nested class
This topic has 2 replies on 1 page.

Posts:82
Registered: 4/11/04
Problem instantiating static nested class  
Jun 27, 2004 10:08 PM



 
How come this doesn't work?

public class A {    public static class B {         }}  public class Test {    A.B test = new A.B();  }


The errors i got are:
-Not an enclosing class: A
-No enclosing instance of type A is in scope.

TIA
 

Posts:1,085
Registered: 4/14/03
Re: Problem instantiating static nested class  
Jun 27, 2004 10:23 PM (reply 1 of 2)



 
The code you posted compiled just fine for me.
 

Posts:82
Registered: 4/11/04
Re: Problem instantiating static nested class  
Jun 27, 2004 11:28 PM (reply 2 of 2)



 
The code you posted compiled just fine for me.

Ya you're right... stupid JBuilder failed me again; had to do a clean rebuild for JBuilder to recognize its not an error.
 
This topic has 2 replies on 1 page.