☕
Java
CtrlK
  • Hello World
  • IntelliJ IDEA
  • if-else statement
  • arithmetic expression
  • primitive types
  • primitive type range
  • Type casting
  • Char
  • String
  • Operators
  • Array
  • Switch
  • Prime Number
  • Continue vs Break
  • Inputs
  • OOP
  • Inheritance
  • Composition
  • Encapsulation
  • Polymorphism
  • Override vs Overloading
  • Random
  • Array assign
  • ArrayList
  • data-structures
  • Interface
  • Inner class
  • Abstract
  • Resources
Powered by GitBook
On this page

Composition

composition

class contains one or more other class as variables.

composition is like inheritance

compositon is more flexible than inheritance in most times.

PreviousInheritanceNextEncapsulation

Last updated 2 years ago