Presentation is loading. Please wait.

Presentation is loading. Please wait.

Object Oriented Programming Examples: C++, Java Advantages: 1. reusibility of code 2. ability to adapt (extend) previously written code.

Similar presentations


Presentation on theme: "Object Oriented Programming Examples: C++, Java Advantages: 1. reusibility of code 2. ability to adapt (extend) previously written code."— Presentation transcript:

1 Object Oriented Programming Examples: C++, Java Advantages: 1. reusibility of code 2. ability to adapt (extend) previously written code

2 Def. Class - a coded computer entity that defines the attributes of an object, including data fields and methods for operating on that data. Def. Object - a computer entity that is created during the execution of a program and is an instance of a class, thereby possessing all of the attributes described in that class. Note: many instances of the same class may be instantiated.

3 Classes can be extended 1. a subclass can be created which inherits all attributes from another class (its parent) or any other superclass that came before it. 2. The subclass can add its own methods and data fields. Ex. Java provides the package called swing which has a large hierarchy of classes for creating graphical user interfaces.

4 Two type of Java programs: 1. applications - run alone like traditional programs 2. applets - may be used as part of a web page and require an HyperTextMarkupLanguage file which is run by a web browser or appletviewer program.

5 Applets - 1. Small Java programs designed to be part of a web page. 2. May reside on any computer attached to the Internet and may be run on any other computer (of any platform) using a program called a Web browser. 3. May also be run on the same computer on which it resides using a program called an appletviewer (which comes with the Java Virtual Machine)..

6 4. The same object code (byte code) is sent to any user requesting it. The JVM on the user’s computer acts as an interpreter for the user’s particular computer.


Download ppt "Object Oriented Programming Examples: C++, Java Advantages: 1. reusibility of code 2. ability to adapt (extend) previously written code."

Similar presentations


Ads by Google