cs notebook1
  • Introduction
  • sort algorithm
  • Overloading VS Overriding
  • multithreading
  • Concurrency0
  • Concurrency1
  • ExecutorService
  • iteration & recursion
  • IO
  • Marker interface(Serializable, Clonnable&Remote)
  • Jackson Library
  • java.lang.System.*
  • Virtual Memory
  • Java ClassLoader
  • interfaceVSabstractClass
  • ENUM
Powered by GitBook
On this page

Was this helpful?

Overloading VS Overriding

Previoussort algorithmNextmultithreading

Last updated 5 years ago

Was this helpful?

  • Overloading is about same function have different signatures.

  • Overriding is about same function, same signature but different classes connected through inheritance.

  • Overloading is an example of compiler time polymorphism and overriding is an example of run time polymorphism.

overloading

e.g.1

//no exception. String is subclass of Object
public method(String s){...}
public method(Object o){...}

e.g.2

// no exception
public method(Sting s){...}
public method(Object o){...}
public method(Integer i){...}

e.g.3 to be continue...

null????

Override

polymorphism