Qualcomm Interview Question: How would you decide when to ... | Glassdoor

Interview Question

LTE Software Developer Interview San Diego, CA

How would you decide when to use Inheritance and when to

  create object. (difficult for me because I have no experience in object oriented programming)

Interview Answer

1 Answer


You meant inherit from a class vs. create a new class (instead of object), right? Just use the "is a" relationship. It's really all a matter of whether it logically makes sense to inherit (for example a dog should definitely inherit from an animal class if it exists, since dog has all the existing traits of an animal- a dog "is an" animal).

moaxgeni on Oct 8, 2012

Add Answers or Comments

To comment on this, Sign In or Sign Up.