This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have saved the file as Zoo.java. After javac Zoo.java both Zoo.class and Moo.class are created.
But for java Moo and java Zoo, I get "Exception in thread "main":NoSuchMethodError:main"
Does this indicate that I need to use the main method in Moo?
When is the main method not needed.
The main method is needed if you want to execute your program. The Moo does not have it, so you can't do "java Moo". In fact, none of your classes have a main method, so you're not expected to execute any of them. Just to compile them.