About 417,000 results
Open links in new tab
  1. java - Do subclasses inherit private fields? - Stack Overflow

    A subclass does not inherit the private members of its parent class. However, if the superclass has public or protected methods for accessing its private fields, these can also be used by the subclass.

  2. What's the difference between a subclass and a subtype?

    Dec 14, 2017 · Therefore while the subclass can pass anytime you need a type of the parent class, the type of the parent class should be rejected if you need the type of the subclass. If you combine this …

  3. java - What is a Subclass - Stack Overflow

    A subclass is a class that describes the members of a particular subset of the original set. They share many of characteristics of the main class, but may have properties or methods that are unique to …

  4. Python subclassed methods with additional arguments

    Nov 22, 2019 · Given the following structure where I want a method with a common name for each class, but each derived class needs an additional piece of information in order to form the …

  5. How do I declare custom exceptions in modern Python?

    How do I declare custom exception classes in modern Python? My primary goal is to follow whatever standard other exception classes have, so that (for instance) any extra string I include in the exc...

  6. c# - How can I add properties to subclasses and access them without ...

    Jul 28, 2015 · For example, for the 8Point subclass, I need to add a Breakeven property, but this property doesn't make sense for other subclasses. The ability to add public properties to all …

  7. python - Subclass in type hinting - Stack Overflow

    I want to allow type hinting using Python 3 to accept sub classes of a certain class. E.g.:

  8. Is creating subclasses for specific instances a bad practice?

    Oct 1, 2014 · There is no need to have specific subclasses for every person. You're right, those should be instances instead. Goal of subclasses: to extend parent classes Subclasses are used to extend …

  9. Check if a Class Object is subclass of another Class Object in Java

    where in general, List (above) should be replaced with superclass and myClass should be replaced with subclass From the JavaDoc: Determines if the class or interface represented by this Class object is …

  10. Overriding fields or properties in subclasses - Stack Overflow

    Subclasses must: Parameterize the implementation of an abstract class. Fully inherit the implementation of the abstract class; Have your own implementation. In this case, the properties that are necessary …