Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section
borderfalse
Column

Column
width500px
Code Block
lineNumberstrue
titleCat.java
borderStyledashed
public class Cat{
  private int age;
  private String name;

  public Cat(String name, int age){
    this.name = name;
    this.age = age;
  }

  public String getName(){
    return name;
  }

  public String sayHello(){
    return "Hello World!  My name is " + name 
        + " and I am " + age + " years old.";
  }
}
Column
width10px

Column
width500px
Code Block
titleCatsTheMusical.java
public class CatsTheMusical{
  public static void main(String[] args){
    Cat mist = new Cat("Mr. Mistoffelees",8);
    System.out.println(mist.sayHello);
  }
}