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 return in java?
Can a lock be acquired on a class in java programming?
What is assembly condition codes?
What is the use of math abs in java?
Can I declare class as static or private?
What is 16 bits called?
Is java owned by oracle?
If system.exit (0); is written at the end of the try block, will the finally block still execute?
Which is better stringbuilder or stringbuffer?
Explain the features of interfaces in java?
How do you call a reference in java?
What are the main features of java?
How will you communicate between two applets?
Can I override protected method in java?
What is method overloading in JAVA? Why is it not present in C ?