Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 830 Bytes

File metadata and controls

40 lines (28 loc) · 830 Bytes

FACADE AND DECORATOR

YOU CAN IMPLEMENT AN INTERFACE/ABSTRACT CLASS

BY COMPOSITION, MAKING IT BE ATTRIBUTE OF ANOTHER CLASS

IF ATRIBUTE IS MUTABLE -> MAKE IT PRIVATE

ACCESSIBLE THROUGH GETTERS/SETTERS

STATIC ATTRBS AS WELL, HAVE STATIC METHODS TO CHANGE THOSE

Interfaces -> What those type MUST do

interface Smart(){ public study(); }

class Student IMPLEMENTS Smart{ // MUST IMPLEMENT study(); @Override String study(){ return "Pass" } }

HEREDITATION OF CONSTRUCTOR

A Child extends Parent

class Child extends Parent { public Child() { super(); // ✅ Good - call parent first // then do child-specific setup }

public Child(String name) { 
    super(name);       // ✅ Good - use parent's logic
    // add child extras
}

}