can we create object for static class in java

Answer Posted / ashlesha sharma

there are two types of classes..
1.Top level class
2.inner class

top level classes cant be declared as static.Its a
compilation error.

inner classes can be declared as follows:
1.Anonymous classes: cant be declared as static.
2.Local classes: cant be declared as static.
3.member classes: the only class that can be declared as static.
4.nested loop level class:A nested top-level class is a
member classes with a static modifier. A nested top-level
class is just like any other top-level class except that it
is declared within another class or interface.

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the uses of java?

574


how can you catch multiple exceptions in java?

543


What do you mean by inner class in java?

568


Do extraneous variables affect validity?

528


Can we initialize the final blank variable?

588






What is the purpose of abstract class?

523


What is gc()?

585


What is the difference between replace and replace all?

477


What is difference between fileinputstream and filereader in java?

563


Which eclipse is best for java?

527


How do you create a method in java?

547


Explain about fail safe iterators in java?

568


what are the disadvantages of indexes in oracle?

1867


What is java life cycle?

540


What is lambda in java?

521