Categories
Certification Java Programming SCJP

Inheritance, some examples for SCJP study

Inheritance is a practice of one thing extending another. So you can more specific subclasses of a class. Inheritance is available in most programming languages, and in Java it is implied using the extends keyword. For example, you may have several objects like Car, Boat, Truck, these may all have common behaviour and state between […]

Categories
Certification Java Programming SCJP

Encapsulation; shielding state via the use of accessors

Encapsulation is a fantastic OOP concept of being able to shield class state via the use of accessor methods. Imagine that you have a class, perhaps called Person. This class will have some form of state, such as name, age, date of birth. These would most likely be stored against reference variables. If you left […]