Object-Oriented Programming I

Class Syntax

A basic class consists only of the class keyword and the name of the class. Check it out:

    class NewClass
      # Class magic here

Our NewClass has the ability to create new Ruby objects of class NewClass (just like "Hello!" is a String and 4 is a Fixnum). By convention, class names start with a capital letter and use CamelCase instead of relying_on_underscores.

Community Forums
Get help and ask questions in the Codecademy Forums
Report a Bug
If you see a bug or any other issue with this page, please report it here.