Tutorial 3 - Classes and Objects

Classes and Objects

  • Objects are collections of related code and data
  • Everything in Java and Groovy can be considered an object
  • A class is a higher level description of an object.
    • For example a 10-Q is a specification developed by the SEC and can be thought of as a "Class". A quarterly report issued by IBM for Q2 2005 can be thought of as an object of the class 10-Q.
  • Documentation for java classes can be found here
  • Documentation for Groovy extensions to Java classes can be found here

Labels

 
(None)
  1. Mar 01, 2007

    Michael King says:

    Not much of a tutorial, eh?  The Java docs provided by Sun read like stereo...

    Not much of a tutorial, eh?  The Java docs provided by Sun read like stereo instructions - it's the main reason why I've stayed away from Java for so long.  Having the tutorial just point to the Sun docs defeats the whole point I see behind Groovy - making it less like Java and more like Ruby (and languages like it).  It's the only reason why I'm even LOOKING at Groovy.

  2. Oct 09, 2007

    Matt Hallam says:

    Thats got to be one of the most obtuse examples of describing the difference bet...

    Thats got to be one of the most obtuse examples of describing the difference between a 'class' and an 'oject' that I've ever seen!

    How about the simple: Dog is an example of a class, whereas Rover is an object (of class Dog)

  3. May 08

    Travis Wellman says:

    So... I came here to see how class definition was the same or different than Jav...

    So... I came here to see how class definition was the same or different than Java class definition. I already know what a blinkin' class is.

    static/private/protected syntax?

    main method/constructor syntax?

    class/instance variable syntax?

    Opening the definition of an existing class or instance and adding stuff? 

    All of the above should be on this page and more.