Classes and main methods?
Hi there,
I am new to java and I seem to have hit a frustrating problem of which I do not understand. I have gone on to learn about class members i.e. writing code with several classes of which is fine but I do not know how to then go on to add the main method, for example, here is my code:
class Zoo {
public String coolMethod () {
return "Wow Baby";
}
}
class Moo {
public void useZoo() {
Zoo z = new Zoo();
System.out.println("A Zoo says, " + z.coolMethod());
}
}
This compiles fine accept when I come to run it it complains that "class Zoo does not have a main method", this is a frustrating because when you follow certain excercises in books etc not all of them run, can someone give me a few pointers as to where I place the main method? I have tried to learn from tutorials but it is still difficult to understand
Hope someone can help
Thanks