static class
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   d_d
Posted On:   Wednesday, June 14, 2006 02:22 AM

Hi Friends, Java not allowing me to create a static nested class in ordinary class. public class xyz{ class opq{ // here i want to create a static object // even i am not able to create a static initilizer private static MyClass myclass; static{ } } } can anybody suggest me the technical reason why its not allowing me to do so. i have make a opq class as static then its working fine. plz help me to clear my doubts. regards    More>>

Hi Friends,

Java not allowing me to create a static nested class in ordinary class.


public class xyz{



class opq{


// here i want to create a static object


// even i am not able to create a static initilizer


private static MyClass myclass;


static{


}


}
}


can anybody suggest me the technical reason why its not allowing me to do so. i have make a opq class as static then its working fine. plz help me to clear my doubts.



regards

   <<Less

Re: static class

Posted By:   Anonymous  
Posted On:   Saturday, September 2, 2006 07:39 AM

non static inner classes cannot have static members.
Where as a static nested class can have static members.
About | Sitemap | Contact