Object Oriented Programming

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 1

Object Oriented Design -Java I.

Identification (30 points) Object class Polymorphism Local Variables Procedural Programming Attributes Abstraction Parameters Encapsulation Protected Object-oriented Inheritance Public Private Fields

1. It is also known as structured programming, a programming style in which the programming task is broken down into a series of operations 2. Programming paradigm that breaks down a programming task into a series of interactions among various entities or objects. This may be considered as an extension of procedural programming in that the actions performed by each object are specified by procedures. 3. Is anything that models things in the real world? These things may be physical entities such as cars, or events such as a concert 4. Are the characteristics that define an object? And also referred to as its states. They differentiate objects of the same class type. For example, your cars attributes include its make, model, year, and purchase price. 5. Is a programming feature that allows a programmer to hide all, but the relevant information (to the problem at hand) about an object in order to reduce complexity and to increase efficiency? 6. Refers to the hiding of data (attributes) and methods within an object. It protects an objects data from corruption. 7. Is a term that describes a group or collection of objects with common properties (both attributes and methods). 8. Is the process by which objects can acquire (inherit) the properties of objects of another class. In OOP, inheritance provides reusability. Additional features may be introduced into an existing class without modifying it. 9. Refers to the ability to process objects differently depending on their data type or class. Specifically, it is the ability to redefine methods for derived classes. 10. These are member variables of a class. 11. These are variables declared in a method or block of code 12. These are variables used in method declarations. 13. This specifies that class members are accessible to anyone, both inside and outside the class. Any object that interacts with the class can have access to the public members of the class. 14. This specifies that the class members are only accessible by the class they are defined in. 15. This specifies that the class members are accessible only to methods in that class and the subclasses of the class. II. Coding 1. 2. 3. 4. 5. 6. 7. Declare a class with a classname myProj (2 points) Code to create object variable r as Bufferedreader object use to recognize input. (5 points) Declare a class with classname myClass with field variables n1 and n2 with data type double (8points) Declare a static method name it mymethod() with local variables n1 and n2 with datatype int (8 points) Declare a dynamic method name it mymethod2() (4 points) Declare a static method with the name setval() with 2 parameter variables int num1 and num2 (8 points) Make an object variable of class with a classname myClass, declaration must be in the main method (10 points) 8. Declare a returning method with name setValue() with 2 parameter variables double also declare local variable sum with double data type and return the sum of the 2 numbers (15 points)

1st Semester, AY 2013 2014 Prelim Examination

*Property of STI Page 1 of 1

You might also like