MCQExams
0:0:1
CBSE
JEE
NTSE
NEET
Practice
Homework
×
Computer Science
Advanced Java Study Guide
Consider a three-dimensional arrayint[] numbers = new int[101010].If this array were to be looped through using for-each loops, what type of variable must be declared in the outermost loop?
Report Question
0%
int
0%
int[]
0%
int[]
0%
int[]
Consider two classes class ChessPiece and class King extends ChessPiece. Suppose King has a method getChecked() that is not found in the super class.Which of the following can be used with ChessPiece cp to access the getChecked() method?
Report Question
0%
((King)cp).getChecked()
0%
(King)(cp).getChecked()
0%
(King)cp.getChecked()
0%
((King)cp.getChecked())
Consider a two-dimensional arrayint[] grid = new int[88]. Which of these for loops will iterate only through the elements on the diagonal from grid[53] to grid[71]?
Report Question
0%
for(int i = 5, j = 3; i <= 7 && j >= 1; i++, j--)
0%
for(int i = 5; i<= 7; i++)for(int j = 3; j >= 1; j--)
0%
for(int i = 5, j = 3; i <= 7 || j >= 1; i++, j--)
0%
for(int i = 5 && j = 3; i <= 7 && j >= 1; i++ && j--)
Consider an array int[] grid = new int[88]. Given two arbitary indices x and y, which of the following for loops will iterate through the 3x3 region centered on (x,y) without ever throwing an ArrayIndexOutOfBoundsException?
Report Question
0%
for(int i = Math.max(0,x-1); i <= Math.min(7,x+1); i++)for(int j = Math.max(0,y-1); j <= Math.min(7,y+1); j++)
0%
for(int i = Math.max(0,x-1), j = Math.max(0,y-1); i <= Math.min(7,x+1) && j <= Math.min(7,y+1); i++, j++)
0%
for(int i = Math.min(0,x-1); i <= Math.max(7,x+1); i++)for(int j = Math.min(0,y-1); j <= Math.max(7,y+1); j++)
0%
for(int i = Math.min(0,x-1), j = Math.min(0,y-1); i <= Math.max(7,x+1) && j <= Math.max(7,y+1); i++, j++)
Consider two classes class ChessPiece and class Knight extends ChessPiece. Suppose ChessPiece and Knight have the same method getMoveset().If Knight k = new Knight(), which of the following is executed when calling k.getMoveset()?
Report Question
0%
Knight.getMoveset(), then ChessPiece.getMoveset()
0%
ChessPiece.getMoveset(), then Knight.getMoveset()
0%
Knight.getMoveset()
0%
ChessPiece.getMoveset()
Which of the following interfaces is used to implement mouse click functionality?
Report Question
0%
MouseAdapter
0%
MouseListener
0%
MouseMotionListener
0%
MouseWheelListener
0:0:1
1
2
3
4
5
6
1
2
3
4
5
6
0
Answered
0
Not Answered
0
Not Visited
Correct : 0
Incorrect : 0
Report Question
×
What's an issue?
Question is wrong
Answer is wrong
Other Reason
Want to elaborate a bit more? (optional)
Support mcqexams.com by disabling your adblocker.
×
Please disable the adBlock and continue.
Thank you.
Reload page