Does JVM create object of Main class (the class with main())? Last Updated : 07 Jan, 2020 Comments Improve Suggest changes Like Article Like Report Consider following program. Java class Main { public static void main(String args[]) { System.out.println("Hello"); } } Output: Hello Does JVM create an object of class Main? The answer is "No". We have studied that the reason for main() static in Java is to make sure that the main() can be called without any instance. To justify the same, we can see that the following program compiles and runs fine. Java // Note Main is abstract abstract class Main { public static void main(String args[]) { System.out.println("Hello"); } } Output: Hello Since we can't create object of abstract classes in Java, it is guaranteed that object of class with main() is not created by JVM. Comment More infoAdvertise with us Next Article Does JVM create object of Main class (the class with main())? K kartik Improve Article Tags : Java java-JVM Practice Tags : Java Similar Reads Different Types of Classes in Java with Examples A class is a user-defined blueprint or prototype from which objects are created. Â It represents the set of properties or methods that are common to all objects of one type. In general, class declarations can include these components, in order: Â Modifiers: A class can be public or has default access 11 min read Class getDeclaringClass() method in Java with Examples The getDeclaringClass() method of java.lang.Class class is used to get the declaring class of this class. The method returns the declaring class of this class, if this class or interface is a member of another class. Else this method returns null. Syntax: public Constructor getDeclaringClass() Param 2 min read Classes and Objects in Java In Java, classes and objects are basic concepts of Object Oriented Programming (OOPs) that are used to represent real-world concepts and entities. The class represents a group of objects having similar properties and behavior, or in other words, we can say that a class is a blueprint for objects, wh 11 min read Java.lang.Class class in Java | Set 1 Java provides a class with name Class in java.lang package. Instances of the class Class represent classes and interfaces in a running Java application. The primitive Java types (boolean, byte, char, short, int, long, float, and double), and the keyword void are also represented as Class objects. It 15+ min read Static Control Flow with Inherited Classes in Java Before understanding the static control flow of a program, we must be familiar with the following two terms: Class loading: It refers to reading the .class file and loading it into the memory(JVM). Java loads classes dynamically, that is, classes are loaded on demand only when they are referred.Clas 6 min read Like