Two. One per class, including the class whose job is merely to hold the static main
method.
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:
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
.
Is the class TestCone
used to create an object?