Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int balls = 1;
- while(balls < 3){
- if(balls == 1){
- System.out.println("I have ball");
- }
- else if(balls == 0){
- System.out.println("No balls :(");
- }
- balls = (balls + 1)/balls;
- }
- //What will this program print out?
- // Because of integer division, the loop will never finish. This results in a stack-overflow error
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement