Friday, January 9, 2015

Headfirst Java, Chapter 1

Chaper 1 of this book was interesting, and its much better than the boring textbooks like in history or math. However, it was only chapter 1, and since I already have a small background in java, I did not really learn too much from this. I did get better at what I already know, however. I was able to troubleshoot the 99 bottles of beer program and successfully make it run. My corrected code is shown below.
99 Bottles of Beer Program.

The error was one line was saying "1 bottles of beer on the wall" and that improper grammar. I simply added an else if statement so that if there was 1 bottle left, it would print "bottle" instead of "bottles". Also, this chapter served as a refresher for me since it has been a year or two since i have done any coding in java, and since then I have learned python. Python syntax is like java in many ways but is less complex. I have found myself almost writing python syntax when writing the code above. I have high hopes for this book, not only as a refresher for what I already know, but also later, to teach me more of the language. 

No comments:

Post a Comment