Home / MCQ Bank / Computer
Computer Array Difficulty: Medium

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); } }

Select the correct option to test your answer:

More Computer Questions

What is the purpose of the 'break' statement in a switch-case construct in C++? Which of the following traversal in a binary tree is similar to depth first traversal? Which one of the following is not an access modifier? Consider the following algorithm for finding the nth Catalan number using dynamic approach. which of the following steps best fills the blank? 1) create and initialize a variable 'n' and an array 'c' 2) initialize the first two values of array as 1 3) _______________________ 4) return c[n] We need system files to run