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 flag in java?
What is methodological theory?
What happens if we override private method?
Is string is a data type in java?
What is re-factoring in software?
What is passing parameters in java?
What are the restrictions that are applied to the java static methods?
Garbage collection in java?
What is the same as procedures?
What is composition in java?
How to convert string to char and vice versa?
What is meant by distributed application? Why are we using that in our application?
Why java is call by value?
What does substring mean?
Can we declare the static variables and methods in an abstract class?