Course Solutions Uncategorized (Solved) : Next Two Questions Based Following Program Public Class Program1 Public Static Void Main S Q30144518 . . . .

(Solved) : Next Two Questions Based Following Program Public Class Program1 Public Static Void Main S Q30144518 . . . .

 

This and the next two questions are based on the followingprogram:

public class Program1 {

public static void main(String[] args)

{

int[] x = new int[3];

int[] y = {3};

int r1 = m(x);

int r2 = m(y);

//at this point, values of x.length, r1, r2?

}

public static int m(int[] x) { int result=0; for (int i=0; i<x.length; i++) { result += x[i]; } return result; }

}

In the main method after the program has evaluated allstatements before the comment, what is the value of x.length?_______________.

What is the value of r1? ____

What

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post