Question: Consider the following declaration. int [ ] beta = new int [ 3 ] ; int j; Which of the following input statements correctly input

Consider the following declaration.
int[] beta = new int[3];
int j;
Which of the following input statements correctly input values into beta? (Assume that console is a Scanner object initialized to the standard input device.)
(i)
beta[]= console.nextInt();
beta[]= console.nextInt();
beta[]= console.nextInt();
(ii)
for (j =0; j <3; j++)
{
beta[j]= console.nextInt();

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!