Can an object be created whoes 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:13 UTC
Read the original article Hit count: 221

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