Results 1 to 5 of 5
  1. #1
    sivasayanth's Avatar
    sivasayanth is offline Member
    Join Date
    Dec 2007
    Posts
    20
    Rep Power
    0

    Default what does it mean?

    i read one document there is one paragraph

    ""In the real world, you'll often find many individual objects all of the same kind. There may be thousands of other bicycles in existence, all of the same make and model. Each bicycle was built from the same set of blueprints and therefore contains the same components. In object-oriented terms, we say that your bicycle is an instance of the class of objects known as bicycles. A class is the blueprint from which individual objects are created.""
    we say that your bicycle is an instance of the class of objects known as bicycles


    what does it mean? above quote? please help me:confused:

  2. #2
    tim's Avatar
    tim
    tim is offline Senior Member
    Join Date
    Dec 2007
    Posts
    435
    Rep Power
    8

    Default Example

    Hello sivasayanth.

    First, understand that:
    1. If we say that one object is an instance of a class then it means that the object has the same attributes and functionality as that class.
    2. Classes are usually expressed by making the first letter capital.

    Try the following example:
    Let's say we have a class called Animal. The class "Animal" has some attributes that gives it meaning and function. Now lets say that we have a "dog" and a "cat". Both are instances of the class "Animal". In Java it can be said:
    Java Code:
    Animal dog = new Animal("Ben", 3);
    Animal cat = new Animal("Jacky", 2);
    Now "dog" and "cat" are similar in the sense that the are both instances of Animal. Now lets define the "Animal" class. Lets say that an Animal has a name and an age. The Animal class could be defined:
    Java Code:
    class Animal{
        // Attributes
        private String name;
        private int age;
        // Behavior
        public void grow(){
            age++;
        }
        // Constructor
        public Animal(name, age){
            this.name = name;
            this.age = age;
        }
    }
    You do not have to understand the code yet, but try to see it as "blueprints" for an Animal.

    Do you understand now? :p
    Eyes dwelling into the past are blind to what lies in the future. Step carefully.

  3. #3
    prash18 is offline Member
    Join Date
    Jan 2008
    Posts
    1
    Rep Power
    0

    Default latest front end updates in java,jsp

    hi

    i would like to learn front end developement using jsp

  4. #4
    beserie is offline Member
    Join Date
    Dec 2007
    Posts
    5
    Rep Power
    0

    Default

    Let's put it this way a class (Bicycles) is like a factory. Each time you press the button "constructor" you get an object (a bicycle) with has all the specification defined in the class. those a called instances of the class Bicycles.

    hope this was enlightening. ;-)

  5. #5
    sivasayanth's Avatar
    sivasayanth is offline Member
    Join Date
    Dec 2007
    Posts
    20
    Rep Power
    0

    Default

    Hello Tim and beserie

    i got the idea. thanks a lot for your explanation

Posting Permissions

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