Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 11, page 603 logic error #28

Open
chessboards opened this issue Jan 23, 2022 · 1 comment
Open

Chapter 11, page 603 logic error #28

chessboards opened this issue Jan 23, 2022 · 1 comment

Comments

@chessboards
Copy link

chessboards commented Jan 23, 2022

public SpeakThreeTimes(Dog dog) {
int i;
for (i = 0; i < 5; i++)
    dog.Speak()
}

prints 5 times instead of 3.

@andrewstellman
Copy link
Collaborator

andrewstellman commented Jan 24, 2022

Thanks – nice catch! That code has been in the book since the first edition, which we published in 2008. You're the first one to spot the problem! I feel like there should be a prize or something for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants