Answers for "main method in java"

2

main method

Main method / main public static void main (String [] arg)
-Public can be anywhere inside or outside package Access Modifier
-Static keyword it means there is only 1 copy specific variable or method and main usage of static you can access it no object. You can call from the class name. It belongs to class
-void means no return type no value at the end
-main is just the name of the method this is method is responsible for running the java application.
Posted by: Guest on June-01-2021
2

java main class

public class Main {
        static void main(String[] args){
           
        }  
}
Posted by: Guest on August-04-2021
0

main methode java

public class Test {

public static void main(String[] args){

	System.out.println("Hello Luggas");
	
	}
}
Posted by: Guest on December-22-2020
2

java main method

public static void main(String args[]){}
Posted by: Guest on February-17-2020
2

main method java

public class Test {

static void main(String[] args){

	System.out.println("Hello World");
	
}
}
Posted by: Guest on March-12-2020
0

how to write a method inside main in java

public class Main {
  static void myMethod() {
    System.out.println("I just got executed!");
  }

  public static void main(String[] args) {
    myMethod();
  }
}

// Outputs "I just got executed!"
Posted by: Guest on May-31-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language