Can you answer these java programming questions? There are a lot of people who think that they can never fail any question they are asked when it comes to java programming, and to help you see if you are right in assuming you are one of these people, we have prepared the quiz below. Do give it a try and See moreget to see if you are all that!
1 2 3 4 Followed by an ArrayIndexOutBoundsException
1 2 3
1 2 3 4
Compilations fails.
Rate this question:
1 3 5 7 1 3
1 3 1 3
1 3 1 3 0 0
Compilation fails.
1 3 Followed by an ArrayIndexOutOfBoundsException
Rate this question:
while (idx <= size - 1){ idx++; }
do { idx++; } while (idx <= size);
while (idx < size) { idx++; }
do { idx++; } while (idx >= size);
do { idx++; } while (idx < size -1);
Rate this question:
2 4
0 2 4 6
0 2 4
Compilations fails.
Rate this question:
while (x >= 0) { System.out.print(array[x]); x--; }
do { x--; System.out.print(array[x]); } while ( x >= 0);
do { System.out.print(array[x]); --x; } while (x >= 0);
while(x > 0) { x--; System.out.print(array[x]); }
while (x > 0) { System.out.print(array[--x]); }
Rate this question:
Compilation fails.
-1
4
3
Rate this question:
Compilation fails.
10 20 30 40
0 0 30 40
An exception is thrown at runtime.
Rate this question:
US: 2 UK: 2
US: 3 UK: 3
US: 2 UK: 4
An ArrayIndexOutOfBoundsException is thrown at runtime.
Rate this question:
5 : 5
10 : 10
5: 10
Compilation fails.
Rate this question:
Quiz Review Timeline (Updated): Mar 22, 2023 +
Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.
Wait!
Here's an interesting quiz for you.