Podcast
Questions and Answers
What is the most appropriate way to declare the data for a Bowler class including high score, average score, and last 10 scores?
What is the most appropriate way to declare the data for a Bowler class including high score, average score, and last 10 scores?
- private int highScore; private double avgScore; private int[] scores; (correct)
- private int highScores, scores; private double avgScore;
- private int highScores; private int[] scores; private double avgScore;
- private int[] scores; private int highScores, avgScore;
What will be printed as a result of executing the code segment: int[] myArray = { 2, 5, 4, -16, -4 }; myArray = myArray ; myArray = myArray ; System.out.println(myArray * (-2)) ;
What will be printed as a result of executing the code segment: int[] myArray = { 2, 5, 4, -16, -4 }; myArray = myArray ; myArray = myArray ; System.out.println(myArray * (-2)) ;
- 0 (correct)
- 18
- 8
- 32
What will be printed as a result of executing the code segment: int[] q = {4, 2, 12, 13, -5}; System.out.println(q.length + q);
What will be printed as a result of executing the code segment: int[] q = {4, 2, 12, 13, -5}; System.out.println(q.length + q);
- 15 (correct)
- 17
- 18
- 16
Which code segment correctly counts the number of odd values in an integer array 'nums' and stores the count in 'oddCount'?
Which code segment correctly counts the number of odd values in an integer array 'nums' and stores the count in 'oddCount'?