Home » JAVA Programming » Loop Control » Question
  1. What is the output of this program?

    public class Result
    {
    public static void main(String args[])
    {
    final int p=10, q=20;

    while(p>q)
    {
    System.out.println("Hello");
    }
    System.out.println("Java");
    }
    }
    1. compile time error
    2. Hello world
    3. run time error
    4. Hello
    5. None of these
Correct Option: A

Every final variable is compile time constant.



Your comments will be displayed only after manual approval.