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 ;
public void payint price
money price;
A The assignment in the constructor must be this money ;
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.
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
