Question

    1.    Predict the output of the code

    public class Animal {

        public static void main(String args[])

                 {       

                    public int localVar = 5;

                 }

             }

    A Error : Illegal Start of Expression Correct Answer Incorrect Answer
    B Compile successfully Correct Answer Incorrect Answer
    C Run Time Exception Correct Answer Incorrect Answer
    D Access specifier not mentioned Correct Answer Incorrect Answer
    E None` Correct Answer Incorrect Answer

    Solution

    The correct answer is A

    Practice Next
    ×
    ×