Fichas
OCP - Basics
Fichas del conjunto (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)
Información
- Descripción
- Fichas sobre OCP - Basics, creado por James Chapter el 11/11/2017.
- Creado por
- James Chapter
- Visitas
- 0
- Valoración