Question: 1 . In the following constructors when I invoke object.transfermoney ( 2 , X ) what will happen? Code public void transfermoney ( ) {

1. In the following constructors when I invoke object.transfermoney(2,X) what will happen?
Code
public void transfermoney(){
System.out.println("HSBC transferring money");
}
public void transfermoney(String To, int amount){
System.out.println("HSBC transferring "+ amount +" to "+ To);
}
public void transfermoney(int To, int amount){
System.out.println("HSBC transferring "+ amount +" to "+ To);
}
a. Code prints HSBC transferring money
b. Code prints HSBC transferring X to 2
c. Code prints HSBC transferring 2 to X
d. Code fails

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