Question: What is wrong with the constructor in the following class: public class Wallet { private int money; public int Wallet ( ) { } money

What is wrong with the constructor in the following class:
public class Wallet {
private int money;
public int Wallet(){
}
money =100;
public void pay(int price){
money -= price;
}
}
(A) The assignment in the constructor must be this . money =100;
(B) It does not have any formal parameters.
(C) It is missing a throws declaration.
(D) It changes a field that is declared private.
(E) It specifies a return type but should not.
 What is wrong with the constructor in the following class: public

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!