O
O
ojiekcahdp2021-04-09 20:16:46
Java
ojiekcahdp, 2021-04-09 20:16:46

Why is the method not returning a value?

My code:

public int giveBalance(int amount) {
    
     return amount;
     
   }

giveBalance(10); // не возвращает значение


What have I done wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Zagaevsky, 2021-04-09
@ojiekcahdp

As you defined that does not return, you anywhere returned value do not save.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question