WorksheetsLecture 4.4 Part 2
Total questions: 11
Worksheet time: 7mins
Java code to create an array of student id with element 115331, 450055, 555641, 875560 and 987555.
int [ ] id = new {115331, 450055, 555641, 875560, 987555};
int [5] id = {115331, 450055, 555641, 875560, 987555};
int [ ] id = {115331, 450055, 555641, 875560, 987555};
int [ ] id = new int [5];
Java code to display the size of an array name studentname[ ].
System.out.println("The size is " + studentname[ index ]);
System.out.println("The size is " + studentname.length);
System.out.println("The size is " + length.length);
System.out.println("The size is " + studentname);
Java code to display all elements of array studentname[ ].
Java code to read elements into array studentname[ ].
Java code to read elements into array customerid[ ].
None of the above is the right answer.
A code segment to identify the largest element in an array.
Based on the code segment below:- identify the name of the array.
for(int j=0; j<balance.length; j++)
{
System.out.print("Enter amount: ");
.......
}
No answer.
temp[ ]
balance
balance [ i ]
What is returned by values[5]?
2
12
6
8
var nums =[2, 3, 5, 8, 9, 11];
How would you access the first element in nums
num(1);
num[1];
num(0);
num[0];
what is the result of :
nums[1]+nums[3]
3
14
6
5
