-
class
i m new in java and would like to ask a silly question. is 1 program means 1 class?? or 1 program can have many class?? for example:
public class first
public static void main (string arg[]){
code.....
public static void register (string arg[])
{ code......}
public static void sales (string arg[])
{ code....}
public static void play (string arg[])
{ code....}
}
please advice
thank you
-
Read up on OOP (Object Oriented Programming) and Inheritance. It will give you a better understanding of what classes are, and how they work within programs.
-
One program can have one class or many classes. That all depends on the program. Java does allow you to declare multiple classes in one file with only one class(the class the file is named after) being public.