


























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
These are the Lecture Slides of Java Programming Language which includes Applet Class, Passing Parameters to Applets, Conversions, Applications and Applets, Running a Program, Applet, Application, Mouse Event, Keyboard Event etc. Key important points are: Class Inheritance, Superclasses and Subclasses, Keywords, Overriding Methods, Object Class, Modifiers, Protected, Final and Abstract, Polymorphism and Object Casting, Interfaces
Typology: Slides
1 / 34
This page cannot be seen from the preview
Don't miss anything!



























๏ Superclasses and Subclasses ๏ Keywords: super ๏ Overriding methods ๏ The Object Class ๏ Modifiers: protected, final and abstract ๏ Polymorphism and Object Casting ๏ Interfaces ๏ Inner Classes ๏ Program Development and Class Design
Superclass^ Circle^ Circle Methods^ Circle Data
Inheritance
Subclass^ Cylinder^ Cylinder MethodsCircle Methods Cylinder Data^ Circle Data
Circle
Cylinder
Superclass Subclass
UML Diagram
TestCylinder Run
The keyword super refers to the superclass of the class in which super appears. This keyword can be used in two ways:
final class Math {...}
final static double PI = 3.14159;
TestPolymorphism (^) Run
Explicit casting must be used when casting an object from a superclass to a subclass. This type of casting may not always succeed.
Cylinder myCylinder = (Cylinder)myCircle;
Use the instanceof operator to test whether an object is an instance of a class:
Circle myCircle = new Circle();
if (myCircle instanceof Cylinder) { Cylinder myCylinder = (Cylinder)myCircle; ... }
modifier interface InterfaceName { constants declarations; methods signatures; }