Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (45k points)

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

A. 3

B. 0

C. 6

D. 1

1 Answer

0 votes
by (99k points)

The correct answer to the question “What will be the output of the following Java Code” is, option (d). 1. And all the other options are incorrect. If you are just starting out in Java, I recommend you check out the Java training course from Intellipaat. Watch the following video on What is Java? From domain experts.

Related questions

Browse Categories

...