CS3101-3 Programming Language-Java Fall 2004 Sept.22
CS3101-3 Programming Language – Java Fall 2004 Sept. 22
Road map today ●Brief review ●Details of class OConstructor Othis reference OInheritance OOverloading ODynamic binding ●Interface ●Exceptions
Road map today lBrief review lDetails of class ¡Constructor ¡this reference ¡Inheritance ¡Overloading ¡Dynamic binding lInterface lExceptions
What is Java OA programming language OA virtual machine JVM OA runtime environment -JRE OPredefined libraries ●Portable,but slow OInterpreter OJIT helps
What is Java lA programming language lA virtual machine – JVM lA runtime environment – JRE ¡Predefined libraries lPortable, but slow ¡Interpreter ¡JIT helps
Object and class ●A class is a blueprint OAn object is an instance created from that blueprint DAll objects of the same class have the same set of attributes OEvery Person object have name,weight,height o But different value for those attributes Oke.name=Ke Wang,sal.name=Sal Stolfo
Object and class lA class is a blueprint lAn object is an instance created from that blueprint lAll objects of the same class have the same set of attributes ¡Every Person object have name, weight, height lBut different value for those attributes ¡ke.name=Ke Wang, sal.name=Sal Stolfo
Class Person:illustration Name:Ke Wang ke height:0 weight:0 Name:Salvatore J.Stolfo sal height:0 weight:0
Class Person: illustration Name: Ke Wang height: 0 weight: 0 Name: Salvatore J. Stolfo height: 0 weight: 0 ke sal