Question: Which declarations, when inserted at (1), will result in the program compiling and printing 90 at runtime? Select the two correct answers. (a) Object[] nums

Which declarations, when inserted at (1), will result in the program compiling and printing 90 at runtime?

public class RQ400A10 { public static void main (String [] args) {

Select the two correct answers.

(a) Object[] nums = {20, 30, 40};

(b) Number[] nums = {20, 30, 40};

(c) Integer[] nums = {20, 30, 40};

(d) int[] nums = {20, 30, 40};

(e) None of the above

public class RQ400A10 { public static void main (String [] args) { // (1) INSERT DECLARATION HERE int sum= 0; for (int i sum += i; System.out.println (sum); } } nums).

Step by Step Solution

3.42 Rating (158 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

c and d The element type of the array nums ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming 8th Questions!