// java classes start with public class // must live in a file using the class name .java // example is .txt for web page public class Dog { public String name; public int age; // no * needed, ALL objects in Java are pointers public Dog friend; public void bark(){ System.out.println(name + " says woof"); } public void birthday(){ System.out.println("happy birthday " + name); age = age + 1; System.out.println(name + " is now " + age); } // real java class would have a method called toString for printing }