1 votes 1 votes which of the following can not be declared static ? a)class b)object c)functions d)member variables Meenakshi Sharma asked Sep 5, 2016 Meenakshi Sharma 2.7k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes A. Class In Java, only nested classes can be declared static. Rakеsh Kumar answered Sep 5, 2016 Rakеsh Kumar comment Share Follow See all 3 Comments See all 3 3 Comments reply Meenakshi Sharma commented Sep 5, 2016 reply Follow Share and object ? 0 votes 0 votes Pavan Kumar Munnam commented Sep 5, 2016 reply Follow Share public static void main it is declared for class...I think object will be the answer 0 votes 0 votes Rakеsh Kumar commented Sep 6, 2016 reply Follow Share @Meenakshi Sharma Yes, an object can be static. @Pavan Kumar Munnam That declaration is of main method, not class. 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes Answer: (A) In fact, all of them can be declared static but a top-level class cannot be made static. A good read: https://stackoverflow.com/questions/7486012/static-classes-in-java the_psycho_scientist answered Aug 9, 2020 the_psycho_scientist comment Share Follow See all 0 reply Please log in or register to add a comment.