Question: Why does the following code snippet lacks cohesion? And what is the solution? 1. public class BankAccount 2.{ 3. private double balance; 4. private

  1. Why does the following code snippet lacks cohesion? And what is the 

Why does the following code snippet lacks cohesion? And what is the solution? 1. public class BankAccount 2.{ 3. private double balance; 4. private String customerName; 5. private String phoneNumber; 6. 7. 8. 9. } public BankAccount(double intitial Balance, String name, String phoneNo){ 10.}

Step by Step Solution

3.50 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer A solution to improve cohesion would be to modify the constructor ... View full answer

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!