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
What is use of static method?
What is nested class?
What is 16 bits called?
What are the topics in core java?
What does 3 dots mean in java?
Can we overload the methods by making them static?
What are the two types of java?
What is string value?
Name and explain the types of ways which are used to pass arguments in any function in java.
What is the purpose of the finalize() method?
How do you allocate memory to object?
What is finally in Java?
What is stream api in java8?
What is an example of character?
Are maps ordered java?