Tuesday, January 20, 2015

Head-First Java - Chapter 2 - What I Learned

This chapter helped me understand the basics of Object Oriented Programming (OOP). I really like the concept of OOP, it turns programming from a laundry list of disjointed code to an organized set of classes and objects that can be changed or added to very easily. It makes more sense in relation to the real world.

Some other things I learned include:
  • main() should only be used to test real classes and/or to launch and start a Java application
  • Objects can "talk" to teach other by calling methods on each other
  • "Global" variables don't really exist in Java OOP, but later we'll learn how using public and static can make a variable behave like a global one
  • A class is like a recipe, whereas objects are like cookies
  • Subclasses can inherit instance variables and methods from superclasses 
 There was no actual code to run in this chapter - it was mostly conceptual.

No comments:

Post a Comment