11 Answered Questions for the topic Inheritance


I am getting an error that constructor "cannot be applied to given types"

Given this code:Main.java class Main { public static void main(String[] args) { SpecificThing mine = new SpecificThing(); System.out.println(mine.double_my_number()); ... more

Inheritance in java

There were Pandavs and Kauravs. Arjun and Bheem were Pandavs. Duryodhan was a Kaurav. Pandavs were characterized by their skills of fighting (fight ( )), obedience (obey ( )), and kindness (kind (... more


Biology College question

In 40% of cases of retinoblastoma, a predisposition to developing the cancer is inherited (as in the pedigrees above). However, in 60% of cases of retinoblastoma, the cancer occurs sporadically... more


Partially Overriding a Virtual Auto-Property in a Child Class?

Time for a theoretical question I just ran across.The following code is valid and compiles: public class Parent { public virtual object TestProperty { get; set; } } public class... more


Prefer composition over inheritance?

Why prefer composition over inheritance? What trade-offs are there for each approach? When should you choose inheritance over composition?
Inheritance Python Class Object


Python class inherits object?

Is there any reason for a class declaration to inherit from ``object``?I just found some code that does this and I can't find a good reason why. class MyClass(object): # class code... more
Inheritance Python Types Oop


What are the differences between type() and isinstance()?

What are the differences between these two code fragments?Using `type()`: import types if type(a) is types.DictType: do_something() if type(b) in types.StringTypes: ... more
Inheritance Ruby Subclass Superclass


Test whether a Ruby class is a subclass of another class?

I would like to test whether a class inherits from another class, but there doesn't seem to exist a method for that. class A end class B < A end B.is_a? A => false ... more
Inheritance Python Class Super


Understanding Python super() with __init__() methods?

I'm trying to understand the use of `super()`. From the looks of it, both child classes can be created, just fine. I'm curious to know about the actual difference between the following 2 child... more


Why couldn't bastards inherit titles?

Why were bastards historically not able to inherit nobility or monarchy from their parents? What about being a bastard made one unfit to rule? For example William IV of the UK was succeeded by his... more
Inheritance Algbra Ratios Ratio


3 Part Ratio

Hi, I need help with this problem, I'm unsure of how to set it up, or solve it. My book says: "An inheritance of $5,000 is to be divided by 3 men in a ratio of 5:3:2. How much will each man... more

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.


Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.