Given the code fragment:
Which modification enables the code fragment to print TrueDone?
Given:
public class Marklist {
int num;
public static void graceMarks(Marklist obj4) {
obj4.num += 10;
}
public static void main(String[] args) {
MarkList obj1 = new MarkList();
MarkList obj2 = obj1;
MarkList obj1 = null;
obj2.num = 60;
graceMarks(obj2);
}
}
How many objects are created in the memory runtime?
You are asked to develop a program for a shopping application, and you are given the following information:
Which definition of the Toy class adds a valid layer of abstraction to the class hierarchy?
Given the following class declarations:
Which answer fails to compile?