ExamVeda
Login
Home
This question belongs to Java Program Array
Array
?

What will be the output of the following Java code?
class evaluate 
{
    public static void main(String args[]) 
        {
      int arr[] = new int[] {0 , 1, 2, 3, 4, 5, 6, 7, 8, 9};
      int n = 6;
            n = arr[arr[n] / 2];
      System.out.println(arr[n] / 2);
        } 
}

Answer & Solution
Correct Answer: Option D
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.