adspace


why static class in java

Answer Posted / Mr Praveen Kumar Jain

A static class in Java serves the following purposes:
1. Static classes can contain only static members (methods and variables). This means they do not need an instance of the class to be created before using them.
2. They are often used for utility or helper classes that provide functionality without requiring object creation.
3. Static classes are useful when you want to ensure that only one instance of a particular class can exist within a Java Virtual Machine (JVM).

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

No New Questions to Answer in this Category !!    You can

Post New Questions

Answer Questions in Different Category