Question: Suppose I have two Java classes named MysticTree and MysticList. These classes have the exact same public method headers, but the details of the code

Suppose I have two Java classes named MysticTree and MysticList. These classes have the exact same public method headers, but the details of the code inside those methods are different (one presumably uses a Tree and the other presumably uses a List).
Select all true statements about MysticTree and MysticList.
Question 13 options:
If I've got a line of code:
MysticTree data = new MysticTree();
And I replace that line of code with:
MysticList data = new MysticList();
Then the program will now have either a compiler error or a runtime error.
MysticTree and MysticList have the same public interface.
If I've got a line of code:
MysticTree data = new MysticTree();
And I replace that line of code with:
MysticList data = new MysticList();
Then the program MIGHT have different output.
If I've got a line of code:
MysticTree data = new MysticTree();
And I replace that line of code with:
MysticList data = new MysticList();
Then the program MIGHT have different memory usage and runtime.
MysticTree and MysticList represent an example of encapsula

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!