+ 4
is it neccesary to create a class in java
4 Answers
+ 3
yes, it is. you should at the very least have the main class.
+ 3
yes each and every code in java is written inside the class.When the program is compiled . java file is translated into .class file.So when we execute a class jvm finds the corresponding .class file of that particular class and executes it
+ 2
since java is %100 object oriented so everything is an object, every object uses a class as the blueprint to create the object, you have to have a class.
+ 1
agree class is mandatory