Java main method

Question

What is the output of the following code:

public class Main {
  public void main(String[] args) {
    double i = 50.0;
    double k = i + 50.0;
    double j = k + 1;

    System.out.println("j is " + j + " and k is " + k);
  }
}


No output
Missing static keyword

Note

The signature of Java entry main method is:

public static void main(String[]){

It can be replaced by one of the following lines:

public static void main(String args[]) 
public static void main(String[] x) 
public static void main(String x[]) 



PreviousNext

Related