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
Is hashset ordered java?
Can you inherit a constructor java?
How does varargs work in java?
What is constructor in java ?
What is canonical name in java?
What is the function of character?
What is the use of set in java?
what is thread? What are the high-level thread states? Or what are the states associated in the thread? : Java thread
What does exclamation mean in java?
How to connect to a remote database using Applet?
What is the purpose of sizeof operator?
What is synchronization and why is it important in java programming?
enlist some features of jdk.
Can a constructor call another constructor?
What is the need of transient variables in Java ?