Java static field Question 1

Question

What is the output of the following code?


public class Main {

  static String name = "Java";

  public static void main(String[] args) {

    System.out.println(name);//from  w  w  w .j  a v  a2 s . c o m

    String name = "Javascript";

    System.out.println(name);

  }

}


Java
Javascript



PreviousNext

Related