Question: X382: Interface Understanding What's wrong with the following code? Assume both the interface and class share the same package. 1 public interface Account { 2

 X382: Interface Understanding What's wrong with the following code? Assume both

X382: Interface Understanding What's wrong with the following code? Assume both the interface and class share the same package. 1 public interface Account { 2 int getAccount Number(); double getAccountBalance(); 4 String getAccountType(); 5} 6 7 public class CheckingAccount implements Account { 8 private int account Number; 9 private double accountBalance; 10 11 public CheckingAccount(int accountNumber, double accountBalance) { 12 this account Number = account Number; 13 this.accountBalance = accountBalance; 14 } 15 16 public int getAccount Number() { 17 return this.account Number + 1000; 18 } 19 20 public String getAccountType() { 21 return "Checking Account"; 22 } 23} Your Answer: Feed Select one answer: Your fee There are no errors, the provided code will compile. The constructor for the class CheckingAccount is missing logic for implementing getAccountType(). The interface is missing access modifiers, e.g. public private, protected The abstract method getAccountBalance() is not implemented in the CheckingAccount class

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 Databases Questions!