troubleshooting Question

Java - boolean

Avatar of zizi21
zizi21 asked on
4 Comments2 Solutions383 ViewsLast Modified:
Hi ,

I came accross a code that read like this:
This is in the parent class.

public boolean drawmoney(double money)
return true;
return false;

Now in the int main, there is a check like this:
System.out.print("No money");

My question is, I find it strange that thereisn't any else statement to witdraw money.
For example,
System.out.print("No money");

Do i assume that when the first if statement is executed, it checks if true, it automatically withdrawsmoney, and only if false, it print...

Pls clarify. Thanks

Mick Barry
Java Developer
Join our community to see this answer!
Unlock 2 Answers and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros