3 Months Free Update
You have been asked to develop a Java program that prints the elements of an array in reverse order.
Which looping statement cannot be used to meet the requirement?
enhanced for
standard for
while
do-while
Given the code fragment:
Which two code fragments are valid at line 2?
for (int count = 0; count < 5; count++) {
System.out.print(count);
}
package p1;
import java.util.*;
public void display() {
List nums = new ArrayList<> ();
{
private int num;
private String name = “John”;
System.out.print(name);
What is the result?
3
A compilation error occurs.
2
0
Identify three advantages of object-oriented programming.
separation of state and behavior
modularity
information sharing
code reuse
information hiding
Given:
At which line does a compilation error occur?
line 5
line 2
line 3
line 7
lotus jasmine
lotus
lotus lily
TESTED 02 May 2024