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
EDS (Electronic Data Systems India Pvt Ltd) at Chennai on 16-12-2006.
What are desktop procedures?
What is the purpose of the System class?
What is the final class modifier?
What is Recursion Function?
What is static import?
Can a final method be overloaded?
Discuss different types of errors that generally occur while programming.
What is difference between jdk,jre and jvm?
How many ways can we create singleton class?
Why string is immutable with example?
Why do we use predicate in java?
What is replaceall in java?
Why do we need array in java?
Explain the scope or life time of class variables or static variables?