How can we run a java program without making any object?



How can we run a java program without making any object?..

Answer / Prabhat Kumar Tiwari

Although it is rare, it's possible to run a Java program without creating any objects. One way to achieve this is by having a static-only main class that only contains static methods (without any instance variables). However, note that the JVM will still create a few system objects such as Thread and System.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

Is c better than java?

1 Answers  


What happens when the main() isn't declared as static?

1 Answers  


Can we execute a program without main() method?

1 Answers  


Explain what is encapsulation?

1 Answers  


What is balanced tree in java?

1 Answers  


What are different types of constants?

1 Answers  


how u do unit testing?

2 Answers   iFlex,


What is the difference between hashmap and hashtable in java?

1 Answers  


Is java util regex pattern thread safe?

1 Answers  


What is charat java?

1 Answers  


we have syntax like for(int var : arrayName) this syntax is to find whether a number is in the array or not.but i want to know how to find that number's location.

1 Answers  


what is the difference between String s="hello"; and String s=new String("hello");?

3 Answers  


Categories