Throwable instance in JAVA
Creating Exceptions Two ways to obtain a Throwable instance: 1) creating one with the new operator All Java built-in exception…
Creating Exceptions Two ways to obtain a Throwable instance: 1) creating one with the new operator All Java built-in exception…
Catching Exceptions: The try-catch Statements class DivByZero { public static void main(String args[]) { try { System.out.print…
Exceptions • Exception is an abnormal condition that arises when executing a program. • In the languages that do not support e…
Defining an interface • Using interface, we specify what a class must do, but not how it does this. • An interface is syntactic…
Java Source File Finally, a Java source file consists of: 1) a single package instruction (optional) 2) several import statemen…
Package A package is both a naming and a visibility control mechanism: 1) divides the name space into disjoint subsets It is …
Abstract Classes • Java allows abstract classes – use the modifier abstract on a class header to declare an abstract class abst…
Polymorphism • Polymorphism is one of three pillars of object-orientation. • Polymorphism: many different (poly) forms of objec…
Subclass, Subtype, and Substitutability The term subtype is used to describe the relationship between types that explicitly r…
Class Hierarchy • Good class design puts all common features as high in the hierarchy as reasonable • The class hierarchy dete…