Programming MisconceptionsHomeMisconceptionsConceptsLanguagesTextbooksContributorsAbout
HomeConcepts
Subtyping

Subtyping

A value of a subtype can be substituted for a value of a supertype.

Related concepts:  TypePolymorphismInheritance

Closest Wikipedia entry:  Subtyping

Misconceptions about Subtyping
11 documented Misconceptions

Any LanguageJavaJavaScriptPythonScratch
Check Yourself
Misconception
CallNotStaticallyChecked — Java
A method invocation on a reference of a type that does not have that method won't compile
Misconception
ConcreteClassOnlyImplementClassAbstract — Java
A concrete class only needs to implement those abstract methods it inherits from abstract superclasses
Misconception
ConcreteClassOnlyImplementDirectAbstract — Java
A concrete class only needs to implement abstract methods declared in its direct supertypes
Misconception
ConcreteClassOnlyImplementInterfaceAbstract — Java
A concrete class only needs to implement those abstract methods it inherits from interfaces
Misconception
ExceptionRoot — Java
Exception is the top-most exception class
Misconception
InterfaceExtendClass — Java
An interface can extend a class
Misconception
MultipleSuperclasses — Java
A class can have multiple superclasses
Misconception
RuntimeExceptionChecked — Java
RuntimeExceptions are checked exceptions
Misconception
StaticDispatch — Java
The method to be called is determined by the static type
Misconception
SubtypeCompatibleWithSupertype — Java
A variable of a subtype can reference an object of a supertype
Misconception
SupertypeIncompatibleWithSubtype — Java
A variable of a supertype cannot reference an object of a subtype

Find Misconceptions by...

Concept
Programming Language
Notional Machine
Textbook

About

About This Site
Structure and Content of the Inventory
Contributors