Given the code fragment:
Which option represents the state of the num array after successful completion of the outer loop?
Given the following code for the classes MyException and Test:
What is the result?
public class StringReplace { public static void main(String[] args) { String message = "Hi everyone!";
System.out.println("message = " + message.replace("e", "X")); }
}
What is the result?
Given:
class Sports {
int num_players;
String name, ground_condition;
Sports(int np, String sname, String sground){
num_players = np;
name = sname;
ground_condition = sground;
}
}
class Cricket extends Sports {
int num_umpires;
int num_substitutes;
Which code fragment can be inserted at line //insert code here to enable the code to compile?
Given:
And given the code fragment:
Which two modifications enable the code to print the following output? (Choose two.) Canine 60 Long Feline 80 Short
. Replace line n1 with:
A:
Replace line n1 with:
B:
Replace line n2 with:
C:
Replace line n1 with:
D:
Replace line n2 with:
E: