Donald Cooper

Greenhorn
+ Follow
since Oct 18, 2018
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Donald Cooper

Hello,

I am learning Java via Sybex OCA Book.

I have reached while loop description which has the following example on page 77:



What confused me was that bitesOfCheese was never explicitly initialized, however still gets value of 5 assigned upon execution of eatCheese and therefore can legally participate in while expression check.
Could you please explain why does it automatically gets assigned the value of 5?

Thank you.