Question: Using the given definition of the Measurable interface: 2 Consider the following code snippet, assuming that BankAccount has a getBalance method and implements the Measurable
Using the given definition of the Measurable interface:
Consider the following code snippet, assuming that BankAccount has a getBalance method and implements the Measurable interface by providing an implementation for the getMeasure method:
Measurable new Measurable;
System.out.printlnmgetMeasure;
Which of the following statements is true?
The code executes, displaying the measure of the Measurable object.
The code does not compile because interface types cannot be instantiated.
The code compiles but generates an exception at run time because getMeasure does not return a String.
The code compiles but generates an exception at run time because does not reference a BankAccount object.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
