go to previous page   go to home page   go to next page

Answer:

Two. One per class, including the class whose job is merely to hold the static main method.


Running the Program

If Cone.java contains the definition of the Cone class and TestCone.java contains the above program and both are in the same disk directory, then the program could be compiled and run by doing:

Running Cone Program

You don't need to do the DIR commands, of course, but it is useful to see what is going on.

If you put both classes into one source file, then it should be named TestCone.java and the modifier public should be removed from the class Cone.


QUESTION 12:

Is the class TestCone used to create an object?


go to previous page   go to home page   go to next page