2 Replies Latest reply: Jan 9, 2013 3:10 PM by aksarben RSS

    objects

    983102
      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
          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
            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!