Karteikarten
OCP - Basics
Karten in diesem Stapel (3)
- 1Overloading DefinitionFor overloading, the method parameters must vary by type and/or numbers
- 2What happens if there are multiple overloaded methods?Java looks for the closest match first. It tries to find the following: Exact match by type, matching a superclass type, converting to a larger primitive type, converting to an autoboxed type, varargs
- 3Rules for overriden methodsthe access modifier must be the same or more accessable. The return type must be the same or more restrictive type, also known as covariant return type. If any checked exceptions are thrown, only the same exceptions or subclasses of those exceptions are allowed to be thrown.
The methods must not be static (If they are, the method is hidden and not overriden)
Informationen
- Beschreibung
- Karteikarten am OCP - Basics, erstellt von James Chapter am 11/11/2017.
- Erstellt von
- James Chapter
- Aufrufe
- 0
- Bewertung