Fichas
SCC212 - Java textbook definitions
Fichas del conjunto (18)
- 14 principles of OOAbstraction
Inheritance
Encapsulation
Polymorphism - 2Parameter passing100% pass by value
if an object reference is passed as a method
parameter, this is also pass by value, and produces a
copy of the reference - 3thisreturns an object reference to the
instance which the current method is executing in - 4Reference and value typesreference = object references
value = primitive types - 5Motivation for inheritancereuse and extensibility
- 6Inheritanceone class can inherit from, be derived from, or
extend another to create new class - 7Inheritance terminologyThe class being extended is known as the base class, super class or
the parent class.
The new class is known as a subclass of the other.
A class can have many subclasses - 8Inheritance is..Transitive
f a class is a subclass of another, it is also a subclass of that classes
parent class - 9In an inheritance hierarchy what happens the closer we get/the further we get from super?Closer = generalist/abstract
Further = specialist/domain specific - 10Super()call the constructor of the parent class
- 11Method overridingAllows specialized behaviour of an already existing class
e.g. new instance variables, method - 12Method overloadingmultiple of a method with different parameter lists
- 13PolymorphismAn object reference of one type, can actually refer to an object of a different type!
- 14Casting polymorphismimplicitly and transparently cast an object reference as necessary, provided
that the transformation goes upwards the inheritance hierarchy
Casting down the hierarchy must be done explicitly - 15Abstract classOnly be extended, never instantiated
- 16Limits of inheritance in javaclasses can only extend precisely one other class
- 17InterfacesInterface is an abstract specification of zero or more methods
A class can elect to implement any number of interfaces - 18-
Información
- Descripción
- Fichas sobre SCC212 - Java textbook definitions, creado por Mac Howarth el 16/05/2017.
- Creado por
- Mac Howarth
- Visitas
- 1
- Valoración