This discussion is archived
2 Replies Latest reply: Jan 9, 2013 1:10 PM by aksarben RSS

objects

983102 Newbie
Currently Being Moderated
justy learned objects. Kind of stuck on what makes one. why say class in the folowing statement;

fredclass jonobject = new fredclass

what is new for?

jon
toronto
  • 1. Re: objects
    rp0428 Guru
    Currently Being Moderated
    Welcome to the forum!
    >
    justy learned objects. Kind of stuck on what makes one. why say class in the folowing statement;

    fredclass jonobject = new fredclass

    what is new for?
    >
    To create a 'new' instance of a class.

    The place to start is the Java Tutorial. It covers all of the basic Java language and has examples.

    See 'What Is a Classs?'
    http://docs.oracle.com/javase/tutorial/java/concepts/class.html

    It has a BicycleDemo example (including sourced code) that should help answer your questions.
  • 2. Re: objects
    aksarben Journeyer
    Currently Being Moderated
    FYI, the correct syntax would be new fredclass() (note the parentheses). And by convention, class names start with capital letters.

    Good luck in your learning process!

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points