• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help plz

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
The answers given are 4 & 5.Why not 3..i dont understand why 4 is the answer.
Vandanam,
vijay
6). Which two demonstrate a "has a" relationship? (Choose two.)
1.public interface Person{ }
public class Employee extends Person{ }
2.public interface Shape{ }
public interface Rectangle extends Shape{ }
3.public interface Colorable{ }
public class Shape implements Colorable{ }
4.public class Species{ }
public class Animal{private Species species;}
5.interface Component{ }
class Container implements Component{
private Component[] children;
}
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

3.public interface Colorable{ }
public class Shape implements Colorable{ }
4.public class Species{ }
public class Animal{private Species species;}
5.interface Component{ }
class Container implements Component{
private Component[] children;
}

Hi Vijay,
In 3 there's "is a" relationship : Shape is a Colorable.
In 4 there's "has a" relationship : Animal has a Speices, although meaning-less.
Hope this helps,

------------------
Regards
---------
vadiraj

*****************
There's a lot of I in J.
*****************
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic