Can an object be created whose instance variables are already existant objects?

Posted by David on Stack Overflow See other posts from Stack Overflow or by David
Published on 2010-04-14T23:12:23Z Indexed on 2010/04/14 23:23 UTC
Read the original article Hit count: 245

Filed under:
|

For example can I have

class Dog
{
    int legs; 
    Bone chewy; 
    Bone squeeky; 

    public Dog (Bone chewyO, Bone squeekyO) 
    { 
        this.legs = 4; 
        chewy = chewyO;
        squeeky = squeekyO; 
    } 

...

© Stack Overflow or respective owner

Related posts about java

Related posts about objects