Skip to content

Module 7 quiz on code “dissection” :Java for Android (Android App Development Specialization) Answers 2025

Question 1

Lines 54–58 show an example of:

✔️ a constructor that makes an explicit call to a constructor in the super class.
❌ a default constructor in a subclass.
❌ a constructor that makes an implicit call to a constructor in the super class.
❌ a mutator method that makes an explicit call to a constructor in the super class.


Question 2

Line ___ is the first line of an overridden method in the subclass.

✔️ Line 63


Question 3

Line ___ is the first line of a mutator method that is inherited by the subclass.

✔️ Line 23


Question 4

Line ___ is the first line of a method in the super class that is not inherited by the subclass.

✔️ Line 44


Question 5 — Select all valid lines inside the subclass

✔️ super.setMonth(8);
✔️ int num = super.getDays();
✔️ convertToString();
❌ super.convertToString();
✔️ this.name = inputString;
✔️ setMonth(8);


Question 6 — Select all valid lines in a client file

SchoolMonth y = new SchoolMonth(11);
y.semester = 'F'; // semester is likely private → error

✔️ Month x = new Month();
✔️ Month[] summer = new Month[3];

SchoolMonth x = new SchoolMonth(7);
setMonth(4); // cannot call method without object reference

✔️

SchoolMonth x = new SchoolMonth(7);
x.setMonth(3); // valid public mutator

Summary Table

Question Answer
Q1 a constructor that makes an explicit call to a constructor in the super class ✔️
Q2 Line 63
Q3 Line 23
Q4 Line 44
Q5 (valid lines) super.setMonth(8);
int num = super.getDays();
convertToString();
this.name = inputString;
setMonth(8);
Q6 (valid lines) Month x = new Month();
Month[] summer = new Month[3];
x.setMonth(3);