I didn't understood about class and main in java! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I didn't understood about class and main in java!

Describe briefly the class and main used in Java through simple daily life examples!

25th Mar 2019, 10:22 AM
Zain Ul Abdin
Zain Ul Abdin - avatar
1 Answer
- 1
Main in java is the starting point it will read it like this: public static void main(String[] args) { // This will prints out first System.out.println("First"); // Now our myMethod will be printed myMethod(); // This will be printed last System.out.println("Third"); } static void myMethod(){ System.out.println("Second"); } // output First Second Third You can read about objects and classes here: https://www.javatpoint.com/object-and-class-in-java
25th Mar 2019, 11:13 AM
JavaBobbo
JavaBobbo - avatar