Results 1 to 3 of 3

Thread: class

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Posts
    2

    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
    laaaaaaaaaa

  2. #2
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    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.
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  3. #3
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width