Search:

Type: Posts; User: helloworld922

Search: Search took 0.09 seconds.

  1. Replies
    8
    Views
    1,399

    Re: Inheritance - Object class

    How do you refer to a class instance? It's done using a variable. A variable must have exactly one type explicitly declared for as long as the variable exists.

    So you want a variable that can...
  2. Replies
    8
    Views
    1,399

    Re: Inheritance - Object class

    I think you're confusing the actual instances vs. variables.

    All variables must have a type in Java. This is fixed and must be explicitly declaring it, a variable will always hold a value/instance...
  3. Replies
    8
    Views
    1,399

    Re: Inheritance - Object class

    You're saying 2 things:


    Object o

    This declares a variable. It has a type Object. That means it can hold an instance of the Object class, or any class which extends the Object class.


    o =...
  4. Replies
    8
    Views
    1,399

    Re: Inheritance - Object class

    area isn't a method of the Object class.

    What does it even mean to take the area of an Object? What if that Object is a String?

    The compiler has no way of knowing what type of object the...
Results 1 to 4 of 4