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!
1 ответ
- 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