73.6k views
2 votes
Given this method comment, fill in the blank in the method implementation. /* Deposits money into the bank account amount: the amount to deposit */ public _____ deposit(double amount) { balance = balance + amount; }

User Hutchbat
by
7.9k points

1 Answer

7 votes

Answer:

"void" is the correct answer for the given question.

Step-by-step explanation:

In the function body the value of balance variable is not return that means we use void return type .The void return type is used when the function does not return any value .

If the function are int return type that means it return "integer value ".

if the function are double return type that means it return the "double value" .

The complete implementation of this method is

public void deposit(double amount) // function definition

{

balance = balance + amount; // statement

}

User Konmik
by
8.0k points