1. Write two major differences between Object-oriented programming and procedural programming?

Size: px
Start display at page:

Download "1. Write two major differences between Object-oriented programming and procedural programming?"

Transcription

1 1. Write two major differences between Object-oriented programming and procedural programming? A procedural program is written as a list of instructions, telling the computer, step-by-step, what to do: Open a file, read a number, multiply by 4, display something. Program units include the main or program block, subroutines, functions, procedures; file scoping; includes/modules; libraries. OOP achieves its goal of overcoming the drawbacks of procedural programming. An object-oriented programming language (also called an OO language) is one that allows or encourages, to some degree, object-oriented programming techniques such as encapsulation, inheritance, modularity, and polymorphism. 2. What is abstraction? Abstraction refers to the act of representing essential features without including the background details or explanation. 3. What do you understand by programming paradigm? What are the various programming paradigms? A programming paradigm defines the methodology of designing and implementing programs using the key features and building blocks of a programming language. The various programming paradigms are: Procedural programming, Object based programming and Object-oriented programming. 4. What are the characteristics of procedural programming? Procedural programming is fine for small projects. It is the most natural way to tell a computer what to do, and the computer processor's own language, machine code, is procedural, so the translation of the procedural high-level language into machine code is straightforward and efficient. The procedural programming has a built-in way of splitting big lists of instructions into smaller lists: the function. 5. What is an object? What is a class? How is an object different from a class? Object is an identifiable entity with some characteristics and behavior. A class is a group of objects that share common properties and relationships. Car is not an object. We can say the Santro is an object of class type car where Car is a class. 6. What is Object-oriented programming paradigm? Name the four basic concepts of OOP. 1

2 OOP achieves its goal of overcoming the drawbacks of procedural programming. An object-oriented programming language (also called an OO language) is one that allows or encourages, to some degree, object-oriented programming techniques such as encapsulation, inheritance, modularity, and polymorphism. 7. What is meant by abstraction? Abstraction refers to the act of representing essential features without including the background details or explanations. 8. What is encapsulation? Why is data considered safe if encapsulated? It is the way of wrapping up of data and functions that operate on that data under a single unit. The class groups its members into three categories: private, protected and public. The private and the protected members are hidden from the outside world. Thus, class enforces data hiding. 9. How are the terms abstraction and encapsulation related? Using the method of encapsulation, the programmer cannot directly access the data. Data is only accessible through the functions present inside the class. Data encapsulation leads to the important concept of data hiding. Data hiding is the implementation details of a class that are hidden from the user. 10. What is a base class? What is a subclass? What is the relationship between a base class and subclass? Inheritance is implemented in C++ by specifying the name of the base class from which the derived class is to be created. The relationship is parent-child-relationship. 11. How does inheritance support reusability? The derived classes have all the features of the base class and the programmer can choose to add new features specific to the newly created derived class. 12. What do you mean by the transitive nature of inheritance? Inheritance is one of the important concepts of object-oriented language. There are several reasons why this concept was introduced in object- oriented language. Some major reasons are: (i) The capability to express the inheritance relationship which ensures the closeness with the real world model. (ii) Idea of reusability, i.e., the new class can use some of the features of the old class. (iii) Transitive nature of inheritance, i.e., it can be passed on further. 2

3 13. How are the object s characteristics represented in software terms? How are object s behavior represented in software terms? The main aim is to implement real world object as software object. The Real-world objects have physical characteristics (state) and behavior (methods). 14. How is data hiding implemented in C++? The main aim is to implement real world-object as a software object. Real-world objects have physical characteristics (state) and behavior (methods). E.g. a car has: (please fill in the required details)( The example is incomplete). 15. Which construct implements encapsulation in C++? Class is use to describe encapsulation. A class only binds the data and the associated functions together as one unit. 16. What is abstract class? What is concrete class? Abstract classes are classes that contain one or more abstract methods. An abstract method is a method that is declared, but contains no implementation. A concrete class is a class which is derived from the abstract class. 17. Define the following terms: (i) Inheritance (ii) Encapsulation Inheritance is the capacity of one class of things to inherit capabilities or properties from another class. Polymorphism is the ability for a message or data to be processed in more than one form. 18. What is polymorphism? How does function overloading implement polymorphism? Polymorphism is the ability for a message or data to be processed in more than one form. Function overloading refers to the same function name but various operations. 19. Discuss major OOP concepts briefly. The Object-oriented approach views the problem as objects rather than that of procedures. 3

4 Object is an identifiable entity with some characteristics and behavior. For example, we can say Orange is an object. Its characteristics are: it is spherical in shape and it s orange in color. Its behavior is: It is juicy and it tastes sweet-sour. Objects are basic runtime entities in an object- oriented system. They may represent a person, a place, a bank account, a table of data or any item that must be handled. Program should make a communication between objects. A group of objects that share common properties and relationships. We just mentioned that objects contain data and code to manipulate that data. The entire set of data and code of an object can be made a user-defined data type with the help of a class. A class is a collection of objects of a similar type. Data Abstraction Abstraction refers to the act of representing essential features without including the background detail or explanation. Data encapsulation It is the way of wrapping up data and functions that operate on that data under a single unit. Encapsulation is the process of combining data and functions into a single unit called class. Modularity Modularity is the property of a system that has been decomposed into a set of interconnected and loosely joined modules. For example, you must have seen a music system which consists of a cd player, a cassette-player, recorder-player, tuner, speaker, etc. These parts are a complete unit by itself but subparts of the music system. This is how modularity works in OOPS. Inheritance: Inheritance is the capacity of one class of things to inherit capabilities or properties from another class. Inheritance is the process by which new classes called derived classes are created from existing classes called base classes. The derived classes have all the features of the base class and the programmer can choose to add new features specific to the newly created derived class. Polymorphism Polymorphism is the ability for a message or data to be processed in more than one form. Polymorphism is the ability to use an operator or function in different ways. Poly, referring to many, signifies the many uses of these operators and functions. A single function usage or an operator functioning in many ways can be called polymorphism. Polymorphism refers to codes, operations or objects that behave differently in different contexts. 20. What is programming paradigms? Give the names of popular programming paradigms. 4

5 A programming paradigm is a fundamental style of writing computer programs. This is the methodology of designing and implementing programs using the key features and other building blocks of a programming language. A programming paradigm gives us an idea of analyzing and solving the problem using programming language. A programming paradigm defines the methodology of designing and implementing programs using key features and building blocks of a programming language. The various programming paradigms are: Procedural programming, Object based programming and Object-oriented programming. 21. What are the short comings of procedural and modular programming? Modularity is generally desirable, especially in large, complicated programs. Inputs are usually specified syntactically in the form of arguments and the outputs delivered as return values. Scoping is another technique that helps keep procedures strongly modular. It prevents the procedure from accessing the variables of other procedures (and vice-versa), including previous instances of itself, without explicit authorization. Less modular procedures, often used in small or quickly written programs, tend to interact with a large number of variables in the execution environment, which other procedures might also modify. Due to the ability to specify a simple interface, to be self-contained, and to be reused, procedures are a convenient vehicle for making pieces of code written by different people or different groups, including through programming libraries. 22. Write a short note on OO programming. The object-oriented programming paradigm is superset of object based programming. Objectoriented programming language overcomes the limitation of object based programming language by implementing inheritance. The various categories of OOP Pure OO languages, everything in them is treated consistently as an object, from primitives such as characters and punctuation, all the way up to whole classes, prototypes, blocks, modules, etc. Languages are designed mainly for OO programming, but with some procedural elements. Languages with most of the features of objects (classes, methods, inheritance, reusability), but in a distinctly original form. Languages with abstract data type support, but not all features of object-orientation, sometimes called object-based languages. 23. How does OOP overcome the shortcomings of the traditional programming approach? 5

6 The focus of procedural programming is to break down a programming task into a collection of variables, data structures, and subroutines, whereas in object-oriented programming - it is to break down a programming task into objects. Either method can be valid for accomplishing a specific programming task. object-oriented methods objects message attribute functions modules argument variable procedural The most important distinction is procedural programming uses procedures to operate on data structures, object-oriented programming bundles the two together so an "object" operates on its "own" data structure. 24. Write a note on Inheritance. Inheritance: Inheritance is the capacity of one class of things to inherit capabilities or properties from another class. Inheritance is the process by which new classes called derived classes are created from existing classes called base classes. The derived classes have all the features of the base class and the programmer can choose to add new features specific to the newly created derived class. For example, a programmer can create a base class named fruit and define derived classes as mango, orange, banana, etc. Each of these derived classes, (mango, orange, banana, etc.) has all the features of the base class (fruit) with additional attributes or features specific to these newly created derived classes. Mango would have its own defined features, orange would have its own defined features, banana would have its own defined features, etc. 25. What are the advantages offered by inheritance? Features or Advantages of Inheritance: Reusability: Inheritance helps the code to be reused in many situations. The base class is defined and once it is compiled, it need not be reworked. Using the concept of inheritance, the programmer can create as many derived classes from the base class as needed while adding specific features to each derived class as needed. Saves Time and Effort: The above concept of reusability achieved by inheritance saves the programmer time and effort. The main reason is that the main code that is written can be reused in various situations as needed. Increases Program Structure which results in greater reliability. 6

7 26. Do you think OOP is closer to real world problems? Why? How? Yes, OOP is closer to real world problems. Let us take a small example of cooking dinner. We are planning to make chapatti, dhal, vegetable subji, rice, potato fry, etc. We have to write a program for it. Using procedural programming paradigm, we ll write a separate program for each recipe and each program will have instructions for using the steamer as a steamer is used to do all the boiling work. But, we don t want to do the code repetition. Once we have written the code its better we reuse it in all places. But it is not possible in case of procedural programming. However, it is solved using the Object-Oriented approach. 27. How are classes and objects implemented in C++? The data and behavior are packed together as classes. Abstraction is relative to the purpose and the user. Class is the software representation of abstraction. An object is an instance of the data type class. Software code in OOP is always pertaining to the class, object and the ways to manipulate the object. Implementing objects The main aim is to implement real world object as software object. In the real world, the objects have physical characteristics(state) and behavior(methods). E.g. a car has: Characteristics: four wheels, number of gears, steering, etc. Behavior: braking, speed, accelerating, etc. A class is defined as: Class <class-name> { }; 28. While implementing encapsulation, abstraction is also implemented. Comment. Yes, while implementing encapsulation, abstraction is also implemented. It is the way of wrapping up data and function that operate on that data under a single unit. Rules to be followed while encapsulating: 1. The attributes that the object doesn t posses is excluded. 2. The unimportant implementation details are hidden. 3. Class is used to describe encapsulation. 29. Discuss the relationship between abstract and concrete class. 7

8 Abstract classes are classes that contain one or more abstract methods. An abstract method is a method that is declared, but contains no implementation. Abstract classes may not be instantiated, and require subclasses to provide implementations for the abstract methods. Let's look at an example of an abstract class, and an abstract method. Suppose we were modeling the behaviour of animals, by creating a class hierarchy that started with a base class called Animal. Animals are capable of doing different things like flying, digging and walking, but there are some common operations as well like eating and sleeping. Some common operations are performed by all animals, but in a different way as well. When an operation is performed in a different way, it is a good candidate for an abstract method (forcing subclasses to provide a custom implementation). Let's look at a very primitive Animal base class, which defines an abstract method for making a sound (such as a dog barking, a cow mooing, or a pig grunting). You may be wondering why not declare an abstract class as an interface, and have the Dog and Cow implement the interface. Sure you could - but you'd also need to implement eating and sleeping methods. This is done using a concrete class which is derived from the abstract class. So we shall have the method for sound that is required before we implement it. 30. Illustrate the concept of inheritance with an example. Inheritance is the process by which new classes called derived classes are created from existing classes called base classes. The derived classes have all the features of the base class and the programmer can choose to add new features specific to the newly created derived class. For example, a programmer can create a base class named fruit and define derived classes as mango, orange, banana, etc. Each of these derived classes, (mango, orange, banana, etc.) has all the features of the base class (fruit) with additional attributes or features specific to these newly created derived classes. Mango would have its own defined features, orange would have its own defined features, banana would have its own defined features, etc. Again, the example for class where the type of car inherits some of the properties from the class automobiles which inherits some of its properties from another class vehicles. 31. Encapsulation is one of the major properties of OOP. How is this implemented in C++? It is the way of wrapping up of data and function that operate on that data under a single unit. Rules to be followed while encapsulating: The attributes where the object doesn t posses is excluded. The unimportant implementation details are hidden. Class is used to describe encapsulation. A class only binds the data and the associated functions together as one unit. The main aim is to implement real-world object as software object. Real world objects have physical characteristics (state) and behavior (methods). E.g. a car has:( The example is incomplete). Please fill in the details. 8

9 A class is defined as Class <class-name> { private: protected: public: }; 32. Reusability of classes is one of the major properties of OOP? How is it implemented in C++? Inheritance is implemented in C++ by specifying the name of the parent class from which the child class is to be created. Syntax Class <child class name>:<parent class name> { child class s own features } 33. How is polymorphism implemented in C++? Polymorphism is an attribute that allows one interface to be used with different situations. In C++, polymorphism is implemented using virtual functions, operator overloading and function overloading. A virtual function is a member function of a class, whose functionality can be over-ridden in its derived classes. It is one that is declared as virtual in the base class using the virtual keyword. Function overloading refers to the same function name but various operations. This implies to the operator overloading too. 34. Write briefly about different programming paradigms. A programming paradigm is a fundamental style of writing computer programs. This is the methodology of designing and implementing programs using key features and other building blocks of a programming language. A programming paradigm gives us an idea of analyzing and solving the problem using programming language. 9

10 A programming paradigm defines the methodology of designing and implementing programs using the key features and building blocks of a programming language. Procedural Programming The traditional programming languages, which students usually learn first are procedural languages. These include C, C++, Fortran, Pascal, and Basic. A procedural program is written as a list of instructions, telling the computer, step-by-step, what to do: Open a file, read a number, multiply by 4, display something. Program units include the main or program block, subroutines, functions, procedures; file scoping; includes/modules; libraries. Procedural programming is fine for small projects. It is the most natural way to tell a computer what to do, and the computer processor's own language, machine code, is procedural, so the translation of the procedural high-level language into machine code is straightforward and efficient. The procedural programming has a built-in way of splitting big lists of instructions into smaller lists: the function. Object based programming Object based programming is the style of programming that primarily supports encapsulation and object identity. Major features of object based programming are: Data encapsulation Data hiding and access mechanisms Automatic initialization and clear-up of objects Operator overloading Advantages and disadvantages of the object based programming language Advantages: Overcomes the shortcoming of procedural language Implements data abstraction and data hiding Supports user-defined data types Disadvantage It does not support inheritance Object-oriented programming language The object-oriented programming paradigm is superset of object based programming. Objectoriented programming language overcomes the limitation of object based programming language by implementing inheritance. The various categories of OOP Pure OO languages, because everything in them is treated consistently as an object, from primitives such as characters and punctuation, all the way up to whole classes, prototypes, blocks, modules, etc. Languages designed mainly for OO programming, but with some procedural elements. Languages with most of the features of objects (classes, methods, inheritance, reusability), but in a distinctly original form. 10

11 Languages with abstract data type support, but not all features of object-orientation, sometimes called object-based languages. 35. Discuss OOP concepts. How are these implemented in software terms in C++? Let us take a small example of cooking for dinner. We are planning to make chapatti, dhal, vegetable subji, rice, potato fry, etc. We have to write a program for it. Using procedural programming paradigm, we ll write a separate program for each recipe and each program will have an instruction for using the steamer which is used to do all the boiling work. But we don t want to do code repetition. Once we have written the code - its better we reuse it in all places. But it s not possible in case of procedural programming. However, it is solved using the Object-Oriented approach. The Object-oriented approach views the problem as objects rather than that of procedures. Object is an identifiable entity with some characteristics and behavior. From the above mentioned problem of cooking, in the OOP approach, will be viewed in terms of objects involved i.e., steamer, oven, gas, etc., and its interface as the operation it performs. This results in simpler programs at a reduced software cost. For example, we can say Orange is an object. Its characteristics are: it is spherical in shape and itis orange in color. Its behavior is: it is juicy and it tastes sweet-sour. Objects are basic runtime entities in a object-oriented system. They may represent a person, a place, a bank account, a table of data or any item that must be handled. Program should make a communication between objects. Definition: A group of objects that share common properties and relationships. We just mentioned that objects contain data and code to manipulate that data. The entire set of data and code of an object can be made as a user-defined data type with the help of a class. A class is a collection of objects of similar type. From the above example, orange is an object but car is not an object. We can say Santro is an object of class type car. Object is an instance of the class. Basic concepts of OOP OOP achieves its goal of overcoming the draw backs of procedural programming. An object-oriented programming language (also called an OO language) is one that allows or encourages, to some degree, object-oriented programming techniques such as encapsulation, inheritance, modularity, and polymorphism. Data Abstraction Definition abstraction refers to the act of representing essential features without including the background details or explanations. Abstraction is one of the most powerful and vital features provided by object-oriented C++ programming language. The concept of abstraction relates to the idea of hiding data that are not needed for presentation. The main idea behind data abstraction is to give a clear separation between 11

12 properties of data type and the associated implementation details. Thus, abstraction forms the basic platform for the creation of user-defined data types called objects. Data abstraction is the process of refining data to its essential form. An Abstract Data Type is defined as a data type that is defined in terms of the operations that it supports but not in terms of its structure or implementation. In object-oriented programming language C++, it is possible to create and provide an interface that accesses only certain elements of data types. The programmer can decide which user to give or grant access to and hide the other details. This concept is called data hiding which is similar in concept to data abstraction. Let us take the TV as an example. We watch the TV, change channels, increase and decrease the volume, switch it on and off, etc., but while watching, we don t get the internal details of the TV like wiring, picture, if the bulb is working, etc. What s happening inside is hidden from us. This is abstraction where you only know essential things to watch the TV without knowing the background detail or explanation. Data encapsulation It is the way of wrapping up of data and function that operate on that data under a single unit. Encapsulation is the process of combining data and functions into a single unit called class. Using the method of encapsulation, the programmer cannot directly access the data. Data is only accessible through the functions present inside the class. Data encapsulation leads to the important concept of data hiding. Data hiding is the implementation details of a class that are hidden from the user. The concept of restricted access led programmers to write specialized functions or methods for performing the operations on hidden members of the class. Attention must be paid to ensure that the class is designed properly. Example: In the school, the class teachers maintain the attendance of the students of their class. When the class teacher of standard XI wants to know the attendance of a particular student in standard XII then the teacher has to approach the class teacher of standard XII to get details. The class teacher of XI cannot get details on her own authority. Modularity: The method of partitioning a program into individual units is called modularity. The reasons for partitioning a program are: It reduces complexity of the program to a certain extent. It creates well-defined,documented boundaries within the program. A module is a separate unit by itself. It can be compiled separately, though, it has connections with other modules. Modules are inter-connected to achieve the goal. Modularity is the property of a system that has been decomposed into a set of interconnected and loosely joined modules. For example, you must have seen a music system which consists of a cd player, cassette-player, recorder-player, tuner or a speaker, etc. These parts make a complete unit when put together. But, by themselves they are subparts of the music system. This is how modularity works in OOPS. Inheritance: Inheritance is the capacity of one class of things to inherit capabilities or properties from another 12

13 class. Inheritance is the process by which new classes called derived classes are created from existing classes called base classes. The derived classes have all the features of the base class and the programmer can choose to add new features specific to the newly created derived class. For example, a programmer can create a base class named fruit and define derived classes as mango, orange, banana, etc. Each of these derived classes, (mango, orange, banana, etc.) has all the features of the base class (fruit) with additional attributes or features specific to these newly created derived classes. Mango would have its own defined features, orange would have its own defined features, banana would have its own defined features, etc. Again the example, class car inherits some of the properties from the class automobiles which inherits some of its properties from another class vehicles. Features or Advantages of Inheritance: Reusability Saves Time and Effort Increases Program Structure which results in greater reliability Polymorphism Polymorphism is the ability for a message or data to be processed in more than one form. Polymorphism is the ability to use an operator or function in different ways. Poly, referring to many, signifies the many uses of these operators and functions. A single function usage or an operator functioning in many ways can be called polymorphism. Polymorphism refers to codes, operations or objects that behave differently in different contexts. Polymorphism is a powerful feature of the object-oriented programming language in C++. A single operator + behaves differently in different contexts such as integer, float or strings referring the concept of polymorphism. Polymorphism refers to the ability to call different functions by using only one type of function call. Suppose a programmer wants to code vehicles of different shapes such as circles, squares, rectangles, etc. One way to define each of these classes is to have a member function for each that makes vehicles of each shape. Another convenient approach that the programmer can take is to define a base class named Shape and then create an instance of that class. Features and Advantages of the concept of Polymorphism: Helps in reusability of code. Provides easier maintenance of applications. Helps in achieving robustness in applications. 13

What is a Programming Paradigm

What is a Programming Paradigm INTRODUCTION This chapter begins with brief discussion of various Programming paradigms that C++ supports i.e., procedural programming style, object based programming style and object oriented programming

More information

OBJECT ORIENTED PROGRAMMING

OBJECT ORIENTED PROGRAMMING 1. Programming Paradigms OBJECT ORIENTED PROGRAMMING A programming methodology defines the methodology of designing and implementing programs using the key features and other building blocks (such as key

More information

CHAPTER 5 GENERAL OOP CONCEPTS

CHAPTER 5 GENERAL OOP CONCEPTS CHAPTER 5 GENERAL OOP CONCEPTS EVOLUTION OF SOFTWARE A PROGRAMMING LANGUAGE SHOULD SERVE 2 RELATED PURPOSES : 1. It should provide a vehicle for programmer to specify actions to be executed. 2. It should

More information

Object oriented programming Concepts

Object oriented programming Concepts Object oriented programming Concepts Naresh Proddaturi 09/10/2012 Naresh Proddaturi 1 Problems with Procedural language Data is accessible to all functions It views a program as a series of steps to be

More information

What are the characteristics of Object Oriented programming language?

What are the characteristics of Object Oriented programming language? What are the various elements of OOP? Following are the various elements of OOP:- Class:- A class is a collection of data and the various operations that can be performed on that data. Object- This is

More information

Unit - IV CHAPTER - 13 INTRODUCTION TO OOP WITH C++ Part 1 Choose the best answer

Unit - IV CHAPTER - 13 INTRODUCTION TO OOP WITH C++ Part 1 Choose the best answer Unit - IV CHAPTER - 13 INTRODUCTION TO OOP WITH C++ Part 1 Choose the best answer 1. The term is used to describe a programming approach based on classes and objects is (A) OOP (B) POP (C) ADT (D) SOP

More information

BASIC CONCEPT OF OOP

BASIC CONCEPT OF OOP Chapter-6 BASIC CONCEPT OF OOP Introduction: Object oriented programmingg is the principle of design and development of programs using modular approach. Object oriented programmingg approach provides advantages

More information

C++ & Object Oriented Programming Concepts The procedural programming is the standard approach used in many traditional computer languages such as BASIC, C, FORTRAN and PASCAL. The procedural programming

More information

STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING

STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING OBJECT ORIENTED PROGRAMMING STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING 1. Object Oriented Programming Paradigms 2. Comparison of Programming Paradigms 3. Basic Object Oriented Programming

More information

Advantages of Object Oriented Programming :- Features of Object Oriented Programming :- Advantages Of Object Oriented Programming :

Advantages of Object Oriented Programming :- Features of Object Oriented Programming :- Advantages Of Object Oriented Programming : Advantages of Object Oriented Programming :- 1. Exploits the expressive power of all object oriented programming languages. 2. Encourages the resuse of software components. 3. Leads to the systems that

More information

Object Oriented Programming using C++

Object Oriented Programming using C++ Object Oriented Programming using C++ Programming Techniques Programming techniques evolved so far Modular programming Structured programming Top down programming Bottom up programming Procedure Oriented

More information

Object Oriented Programming is a programming method that combines: Advantage of Object Oriented Programming

Object Oriented Programming is a programming method that combines: Advantage of Object Oriented Programming Overview of OOP Object Oriented Programming is a programming method that combines: a) Data b) Instructions for processing that data into a self-sufficient object that can be used within a program or in

More information

1: Introduction to Object (1)

1: Introduction to Object (1) 1: Introduction to Object (1) 김동원 2003.01.20 Overview (1) The progress of abstraction Smalltalk Class & Object Interface The hidden implementation Reusing the implementation Inheritance: Reusing the interface

More information

Sri Vidya College of Engineering & Technology

Sri Vidya College of Engineering & Technology UNIT I INTRODUCTION TO OOP AND FUNDAMENTALS OF JAVA 1. Define OOP. Part A Object-Oriented Programming (OOP) is a methodology or paradigm to design a program using classes and objects. It simplifies the

More information

Overview. OOP: model, map, reuse, extend. Examples of objects. Introduction to Object Oriented Design

Overview. OOP: model, map, reuse, extend. Examples of objects. Introduction to Object Oriented Design Overview Introduction to Object Oriented Design Understand Classes and Objects. Understand some of the key concepts/features in the Object Oriented paradigm. Benefits of Object Oriented Design paradigm.

More information

Inheritance (Outsource: )

Inheritance (Outsource: ) (Outsource: 9-12 9-14) is a way to form new classes using classes that have already been defined. The new classes, known as derived classes, inherit attributes and behavior of the pre-existing classes,

More information

Introduction to Object-Oriented Programming

Introduction to Object-Oriented Programming Introduction to Object-Oriented Programming Objects and classes Abstract Data Types (ADT). Encapsulation OOP: Introduction 1 Pure Object-Oriented Languages Five rules [Source: Alan Kay]: Everything in

More information

Object Oriented Programming. C++ 6 th Sem, A Div Ms. Mouna M. Naravani

Object Oriented Programming. C++ 6 th Sem, A Div Ms. Mouna M. Naravani Object Oriented Programming C++ 6 th Sem, A Div 2018-19 Ms. Mouna M. Naravani Object Oriented Programming (OOP) removes some of the flaws encountered in POP. In OOPs, the primary focus is on data rather

More information

Overview of OOP. Dr. Zhang COSC 1436 Summer, /18/2017

Overview of OOP. Dr. Zhang COSC 1436 Summer, /18/2017 Overview of OOP Dr. Zhang COSC 1436 Summer, 2017 7/18/2017 Review Data Structures (list, dictionary, tuples, sets, strings) Lists are enclosed in square brackets: l = [1, 2, "a"] (access by index, is mutable

More information

Chapter No. 2 Class modeling CO:-Sketch Class,object models using fundamental relationships Contents 2.1 Object and Class Concepts (12M) Objects,

Chapter No. 2 Class modeling CO:-Sketch Class,object models using fundamental relationships Contents 2.1 Object and Class Concepts (12M) Objects, Chapter No. 2 Class modeling CO:-Sketch Class,object models using fundamental relationships Contents 2.1 Object and Class Concepts (12M) Objects, Classes, Class Diagrams Values and Attributes Operations

More information

OBJECT ORIENTED SYSTEM DEVELOPMENT Software Development Dynamic System Development Information system solution Steps in System Development Analysis

OBJECT ORIENTED SYSTEM DEVELOPMENT Software Development Dynamic System Development Information system solution Steps in System Development Analysis UNIT I INTRODUCTION OBJECT ORIENTED SYSTEM DEVELOPMENT Software Development Dynamic System Development Information system solution Steps in System Development Analysis Design Implementation Testing Maintenance

More information

Chapter 5 Object-Oriented Programming

Chapter 5 Object-Oriented Programming Chapter 5 Object-Oriented Programming Develop code that implements tight encapsulation, loose coupling, and high cohesion Develop code that demonstrates the use of polymorphism Develop code that declares

More information

Object Oriented Programming in Java. Jaanus Pöial, PhD Tallinn, Estonia

Object Oriented Programming in Java. Jaanus Pöial, PhD Tallinn, Estonia Object Oriented Programming in Java Jaanus Pöial, PhD Tallinn, Estonia Motivation for Object Oriented Programming Decrease complexity (use layers of abstraction, interfaces, modularity,...) Reuse existing

More information

Basics of Object Oriented Programming. Visit for more.

Basics of Object Oriented Programming. Visit   for more. Chapter 4: Basics of Object Oriented Programming Informatics Practices Class XII (CBSE Board) Revised as per CBSE Curriculum 2015 Visit www.ip4you.blogspot.com for more. Authored By:- Rajesh Kumar Mishra,

More information

Data Structures (list, dictionary, tuples, sets, strings)

Data Structures (list, dictionary, tuples, sets, strings) Data Structures (list, dictionary, tuples, sets, strings) Lists are enclosed in brackets: l = [1, 2, "a"] (access by index, is mutable sequence) Tuples are enclosed in parentheses: t = (1, 2, "a") (access

More information

Object- Oriented Design with UML and Java Part I: Fundamentals

Object- Oriented Design with UML and Java Part I: Fundamentals Object- Oriented Design with UML and Java Part I: Fundamentals University of Colorado 1999-2002 CSCI-4448 - Object-Oriented Programming and Design These notes as free PDF files: http://www.softwarefederation.com/cs4448.html

More information

CREATED BY: Muhammad Bilal Arslan Ahmad Shaad. JAVA Chapter No 5. Instructor: Muhammad Naveed

CREATED BY: Muhammad Bilal Arslan Ahmad Shaad. JAVA Chapter No 5. Instructor: Muhammad Naveed CREATED BY: Muhammad Bilal Arslan Ahmad Shaad JAVA Chapter No 5 Instructor: Muhammad Naveed Muhammad Bilal Arslan Ahmad Shaad Chapter No 5 Object Oriented Programming Q: Explain subclass and inheritance?

More information

Object-Oriented Programming Concepts

Object-Oriented Programming Concepts Object-Oriented Programming Concepts Real world objects include things like your car, TV etc. These objects share two characteristics: they all have state and they all have behavior. Software objects are

More information

Object-Oriented Programming Paradigm

Object-Oriented Programming Paradigm Object-Oriented Programming Paradigm Sample Courseware Object-Oriented Programming Paradigm Object-oriented programming approach allows programmers to write computer programs by representing elements of

More information

PROGRAMMING IN C++ COURSE CONTENT

PROGRAMMING IN C++ COURSE CONTENT PROGRAMMING IN C++ 1 COURSE CONTENT UNIT I PRINCIPLES OF OBJECT ORIENTED PROGRAMMING 2 1.1 Procedure oriented Programming 1.2 Object oriented programming paradigm 1.3 Basic concepts of Object Oriented

More information

Object Orientated Analysis and Design. Benjamin Kenwright

Object Orientated Analysis and Design. Benjamin Kenwright Notation Part 2 Object Orientated Analysis and Design Benjamin Kenwright Outline Review What do we mean by Notation and UML? Types of UML View Continue UML Diagram Types Conclusion and Discussion Summary

More information

Object-Oriented Programming in C++/Handout 01 Page 1 of 8

Object-Oriented Programming in C++/Handout 01 Page 1 of 8 Object-Oriented Programming in C++/Handout 01 Page 1 of 8 Table of Contents Table of Contents... 1 Learning Objectives... 2 Object-Oriented Approach... 2 Advantages of Object-Oriented Approach... 2 Principles

More information

MAHALAKSHMI ENGINEERING COLLEGE B TIRUCHIRAPALLI

MAHALAKSHMI ENGINEERING COLLEGE B TIRUCHIRAPALLI MAHALAKSHMI ENGINEERING COLLEGE B TIRUCHIRAPALLI 621213 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Sub code: CS2203 SEM: III Sub Name: Object Oriented Programming Year: II UNIT-I PART-A 1. What is

More information

Object oriented Programming

Object oriented Programming Object-Oriented Programming Chapter 4 Object oriented Programming 91 Chapter 4 Object oriented Programming Chapter 4 Object oriented Programming System modelling helps the analyst to understand the functionality

More information

Chapter3: Introduction to Classes and Objects

Chapter3: Introduction to Classes and Objects Chapter3: Introduction to Classes and Objects Classes and Objects: Definitions Objectives What is an object What is a class UML representation of a class Objects and Instance variables Primitive types

More information

Defining Classes and Methods

Defining Classes and Methods Defining Classes and Methods Chapter 5 Modified by James O Reilly Class and Method Definitions OOP- Object Oriented Programming Big Ideas: Group data and related functions (methods) into Objects (Encapsulation)

More information

The University Of Michigan. EECS402 Lecture 06. Andrew M. Morgan. Savitch Ch. 6 Intro To OOP Classes Objects ADTs.

The University Of Michigan. EECS402 Lecture 06. Andrew M. Morgan. Savitch Ch. 6 Intro To OOP Classes Objects ADTs. The University Of Michigan Lecture 06 Andrew M. Morgan Savitch Ch. 6 Intro To OOP Classes Objects ADTs Complexity Increases A Little History Early computing Cheap Programmers, Expensive Computers Binary

More information

Elementary Concepts of Object Class

Elementary Concepts of Object Class Elementary Concepts of Object Class Modeling entities and their behaviour by objects. A class as a specification of objects and as an object factory, computation as message passing/function call between

More information

Lecture 13: Object orientation. Object oriented programming. Introduction. Object oriented programming. OO and ADT:s. Introduction

Lecture 13: Object orientation. Object oriented programming. Introduction. Object oriented programming. OO and ADT:s. Introduction Lecture 13: Object orientation Object oriented programming Introduction, types of OO languages Key concepts: Encapsulation, Inheritance, Dynamic binding & polymorphism Other design issues Smalltalk OO

More information

Software Development. Modular Design and Algorithm Analysis

Software Development. Modular Design and Algorithm Analysis Software Development Modular Design and Algorithm Analysis Data Encapsulation Encapsulation is the packing of data and functions into a single component. The features of encapsulation are supported using

More information

OOPS Viva Questions. Object is termed as an instance of a class, and it has its own state, behavior and identity.

OOPS Viva Questions. Object is termed as an instance of a class, and it has its own state, behavior and identity. OOPS Viva Questions 1. What is OOPS? OOPS is abbreviated as Object Oriented Programming system in which programs are considered as a collection of objects. Each object is nothing but an instance of a class.

More information

The object-oriented approach goes a step further by providing tools for the programmer to represent elements in the problem space.

The object-oriented approach goes a step further by providing tools for the programmer to represent elements in the problem space. 1 All programming languages provide abstractions. Assembly language is a small abstraction of the underlying machine. Many imperative languages (FORTRAN, BASIC, and C) are abstractions of assembly language.

More information

Chapter 8: Creating Your Own Type Classes

Chapter 8: Creating Your Own Type Classes Chapter 8: Creating Your Own Type Classes What we will learn: Object-oriented programming What is a class How to create a class Assigning values to a class What you need to know before: Data types Methods

More information

ENCAPSULATION. private, public, scope and visibility rules. packages and package level access.

ENCAPSULATION. private, public, scope and visibility rules. packages and package level access. ENCAPSULATION private, public, scope and visibility rules. packages and package level access. Q. Explain the term Encapsulation with an example? Ans: The wrapping up to data and methods into a single units

More information

Programmazione. Prof. Marco Bertini

Programmazione. Prof. Marco Bertini Programmazione Prof. Marco Bertini marco.bertini@unifi.it http://www.micc.unifi.it/bertini/ Introduction Why OO Development? Improved structure of software easier to: Understand Maintain Enhance Reusable

More information

Polymorphism. Object Orientated Programming in Java. Benjamin Kenwright

Polymorphism. Object Orientated Programming in Java. Benjamin Kenwright Polymorphism Object Orientated Programming in Java Benjamin Kenwright Quizzes/Labs Every single person should have done Quiz 00 Introduction Quiz 01 - Java Basics Every single person should have at least

More information

Java Basics. Object Orientated Programming in Java. Benjamin Kenwright

Java Basics. Object Orientated Programming in Java. Benjamin Kenwright Java Basics Object Orientated Programming in Java Benjamin Kenwright Outline Essential Java Concepts Syntax, Grammar, Formatting, Introduce Object-Orientated Concepts Encapsulation, Abstract Data, OO Languages,

More information

CPS 506 Comparative Programming Languages. Programming Language

CPS 506 Comparative Programming Languages. Programming Language CPS 506 Comparative Programming Languages Object-Oriented Oriented Programming Language Paradigm Introduction Topics Object-Oriented Programming Design Issues for Object-Oriented Oriented Languages Support

More information

Software Architecture (Lesson 2) Object-Oriented Paradigm (1)

Software Architecture (Lesson 2) Object-Oriented Paradigm (1) Software Architecture (Lesson 2) Object-Oriented Paradigm (1) Table of Contents Introduction... 2 1.1 Basic Concepts... 2 1.1.1 Objects... 2 1.1.2 Messages... 3 1.1.3 Encapsulation... 4 1.1.4 Classes...

More information

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR 603203 DEPARTMENT OF COMPUTER SCIENCE & APPLICATIONS QUESTION BANK (2017-2018) Course / Branch : M.Sc CST Semester / Year : EVEN / II Subject Name

More information

Government Polytechnic, Muzaffarpur. Name of the Lab: OBJECT ORIENTED PROGRAMMING

Government Polytechnic, Muzaffarpur. Name of the Lab: OBJECT ORIENTED PROGRAMMING Government Polytechnic, Muzaffarpur. Name of the Lab: OBJECT ORIENTED PROGRAMMING THROUGH C++ Practical: OOPS THROUGH C++ Subject Code: 1618407 PROGRAM NO.1 Programming exercise on executing a Basic C++

More information

Unit 1 : Principles of object oriented programming

Unit 1 : Principles of object oriented programming Unit 1 : Principles of object oriented programming Difference Between Procedure Oriented Programming (POP) & Object Oriented Programming (OOP) Divided Into Importance Procedure Oriented Programming In

More information

Chapter 11. Categories of languages that support OOP: 1. OOP support is added to an existing language

Chapter 11. Categories of languages that support OOP: 1. OOP support is added to an existing language Categories of languages that support OOP: 1. OOP support is added to an existing language - C++ (also supports procedural and dataoriented programming) - Ada 95 (also supports procedural and dataoriented

More information

Object-Oriented Languages and Object-Oriented Design. Ghezzi&Jazayeri: OO Languages 1

Object-Oriented Languages and Object-Oriented Design. Ghezzi&Jazayeri: OO Languages 1 Object-Oriented Languages and Object-Oriented Design Ghezzi&Jazayeri: OO Languages 1 What is an OO language? In Ada and Modula 2 one can define objects encapsulate a data structure and relevant operations

More information

Introduction to OOP. Procedural Programming sequence of statements to solve a problem.

Introduction to OOP. Procedural Programming sequence of statements to solve a problem. Introduction to OOP C++ - hybrid language improved and extended standard C (procedural language) by adding constructs and syntax for use as an object oriented language. Object-Oriented and Procedural Programming

More information

Module 10 Inheritance, Virtual Functions, and Polymorphism

Module 10 Inheritance, Virtual Functions, and Polymorphism Module 10 Inheritance, Virtual Functions, and Polymorphism Table of Contents CRITICAL SKILL 10.1: Inheritance Fundamentals... 2 CRITICAL SKILL 10.2: Base Class Access Control... 7 CRITICAL SKILL 10.3:

More information

C++ Programming: Introduction to C++ and OOP (Object Oriented Programming)

C++ Programming: Introduction to C++ and OOP (Object Oriented Programming) C++ Programming: Introduction to C++ and OOP (Object Oriented Programming) 2018 년도 2 학기 Instructor: Young-guk Ha Dept. of Computer Science & Engineering Contents Brief introduction to C++ OOP vs. Procedural

More information

Structured Programming

Structured Programming CS 170 Java Programming 1 Objects and Variables A Little More History, Variables and Assignment, Objects, Classes, and Methods Structured Programming Ideas about how programs should be organized Functionally

More information

Data Structures and Programming with C++

Data Structures and Programming with C++ Data Structures and Programming with C++ By Dr. Atul Kumar Dwivedi ETC, BIT, Durg UNIT-I B. E., V Semester Outline Basic concepts of Object oriented Programming (OOPs) 1. Objects 2. Classes 3. Data encapsulation

More information

OBJECT ORIENTED PROGRAMMING USING C++ CSCI Object Oriented Analysis and Design By Manali Torpe

OBJECT ORIENTED PROGRAMMING USING C++ CSCI Object Oriented Analysis and Design By Manali Torpe OBJECT ORIENTED PROGRAMMING USING C++ CSCI 5448- Object Oriented Analysis and Design By Manali Torpe Fundamentals of OOP Class Object Encapsulation Abstraction Inheritance Polymorphism Reusability C++

More information

What is Inheritance?

What is Inheritance? Inheritance 1 Agenda What is and Why Inheritance? How to derive a sub-class? Object class Constructor calling chain super keyword Overriding methods (most important) Hiding methods Hiding fields Type casting

More information

Software Paradigms (Lesson 3) Object-Oriented Paradigm (2)

Software Paradigms (Lesson 3) Object-Oriented Paradigm (2) Software Paradigms (Lesson 3) Object-Oriented Paradigm (2) Table of Contents 1 Reusing Classes... 2 1.1 Composition... 2 1.2 Inheritance... 4 1.2.1 Extending Classes... 5 1.2.2 Method Overriding... 7 1.2.3

More information

Computer Science 4U Unit 1. Programming Concepts and Skills Modular Design

Computer Science 4U Unit 1. Programming Concepts and Skills Modular Design Computer Science 4U Unit 1 Programming Concepts and Skills Modular Design Modular Design Reusable Code Object-oriented programming (OOP) is a programming style that represents the concept of "objects"

More information

Inheritance & Polymorphism

Inheritance & Polymorphism Inheritance & Polymorphism Procedural vs. object oriented Designing for Inheritance Test your Design Inheritance syntax **Practical ** Polymorphism Overloading methods Our First Example There will be shapes

More information

CS6301 PROGRAMMING AND DATA STRUCTURES II QUESTION BANK UNIT-I 2-marks ) Give some characteristics of procedure-oriented language. Emphasis is on doing things (algorithms). Larger programs are divided

More information

Understanding the Object Paradigm

Understanding the Object Paradigm 2 Understanding the Object Paradigm M MAJOR A J O R T TOPICSO P I C S Objectives... 18 Pre-Test Questions... 18 Introduction... 19 Classes... 19 Classes and Functions... 20 Abstraction... 25 Adding and

More information

LECTURE 3: SOFTWARE DESIGN. Software Engineering Mike Wooldridge

LECTURE 3: SOFTWARE DESIGN. Software Engineering Mike Wooldridge LECTURE 3: SOFTWARE DESIGN Mike Wooldridge 1 Design Computer systems are not monolithic: they are usually composed of multiple, interacting modules. Modularity has long been seen as a key to cheap, high

More information

OOPs Concepts. 1. Data Hiding 2. Encapsulation 3. Abstraction 4. Is-A Relationship 5. Method Signature 6. Polymorphism 7. Constructors 8.

OOPs Concepts. 1. Data Hiding 2. Encapsulation 3. Abstraction 4. Is-A Relationship 5. Method Signature 6. Polymorphism 7. Constructors 8. OOPs Concepts 1. Data Hiding 2. Encapsulation 3. Abstraction 4. Is-A Relationship 5. Method Signature 6. Polymorphism 7. Constructors 8. Type Casting Let us discuss them in detail: 1. Data Hiding: Every

More information

Limitations of Current Implementation of Object Oriented Programming in LabVIEW 8.20 and a Proposal for an Alternative Implementation. v. 1.

Limitations of Current Implementation of Object Oriented Programming in LabVIEW 8.20 and a Proposal for an Alternative Implementation. v. 1. Limitations of Current Implementation of Object Oriented Programming in LabVIEW 8.20 and a Proposal for an Alternative Implementation v. 1.2 Tomi Maila Tomi.Maila@helsinki.fi University of Helsinki August

More information

Chapter 1: Object-Oriented Programming Using C++

Chapter 1: Object-Oriented Programming Using C++ Chapter 1: Object-Oriented Programming Using C++ Objectives Looking ahead in this chapter, we ll consider: Abstract Data Types Encapsulation Inheritance Pointers Polymorphism Data Structures and Algorithms

More information

Object Oriented Programming

Object Oriented Programming Binnur Kurt kurt@ce.itu.edu.tr Istanbul Technical University Computer Engineering Department 1 Version 0.1.2 About the Lecturer BSc İTÜ, Computer Engineering Department, 1995 MSc İTÜ, Computer Engineering

More information

Object Model. Object Orientated Analysis and Design. Benjamin Kenwright

Object Model. Object Orientated Analysis and Design. Benjamin Kenwright Object Model Object Orientated Analysis and Design Benjamin Kenwright Outline Submissions/Quizzes Review Object Orientated Programming Concepts (e.g., encapsulation, data abstraction,..) What do we mean

More information

Software Design and Analysis for Engineers

Software Design and Analysis for Engineers Software Design and Analysis for Engineers by Dr. Lesley Shannon Email: lshannon@ensc.sfu.ca Course Website: http://www.ensc.sfu.ca/~lshannon/courses/ensc251 Simon Fraser University Slide Set: 2 Date:

More information

OBJECT ORİENTATİON ENCAPSULATİON

OBJECT ORİENTATİON ENCAPSULATİON OBJECT ORİENTATİON Software development can be seen as a modeling activity. The first step in the software development is the modeling of the problem we are trying to solve and building the conceptual

More information

Object Oriented Software Design

Object Oriented Software Design Object Oriented Software Design Introduction to Object Oriented Programming Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa September 23, 2010 G. Lipari (Scuola Superiore

More information

Chapter 12 Object-Oriented Programming. Starting Out with Games & Graphics in C++ Tony Gaddis

Chapter 12 Object-Oriented Programming. Starting Out with Games & Graphics in C++ Tony Gaddis Chapter 12 Object-Oriented Programming Starting Out with Games & Graphics in C++ Tony Gaddis Addison Wesley is an imprint of 2010 Pearson Addison-Wesley. All rights reserved. 12.1 Procedural and Object-Oriented

More information

Basics of Object Oriented Programming FCITR MAGAZINE DR. SHAKEEL AHMAD

Basics of Object Oriented Programming FCITR MAGAZINE DR. SHAKEEL AHMAD Basics of Object Oriented Programming FCITR MAGAZINE DR. SHAKEEL AHMAD FACULTY OF COMPUTING AND INFORMATION TECHNOLOGY AT RABIGH KING ABDULAZIZ UNIVERSITY KINGDOM SAUDI ARABIA Introduction Objects are

More information

Introduction to Computers and Programming Languages. CS 180 Sunil Prabhakar Department of Computer Science Purdue University

Introduction to Computers and Programming Languages. CS 180 Sunil Prabhakar Department of Computer Science Purdue University Introduction to Computers and Programming Languages CS 180 Sunil Prabhakar Department of Computer Science Purdue University 1 Objectives This week we will study: The notion of hardware and software Programming

More information

Compilation of Object Oriented Languages Tik Compilers Seminar

Compilation of Object Oriented Languages Tik Compilers Seminar Compilation of Object Oriented Languages Burlacu Mihai Helsinki University of Technology burlacum@cc.hut.fi Abstract The paper covers briefly the object-oriented concepts, usability and advantages of using

More information

Object Oriented Programming. Michał Bereta

Object Oriented Programming. Michał Bereta Object Oriented Programming Michał Bereta www.michalbereta.pl mbereta@pk.edu.pl Time and place Thursday, 18:00 20:15 Classroom 142 Institute of Informatics Warszawska street (Faculty of chemistry building)

More information

Objects and Classes. Amirishetty Anjan Kumar. November 27, Computer Science and Engineering Indian Institue of Technology Bombay

Objects and Classes. Amirishetty Anjan Kumar. November 27, Computer Science and Engineering Indian Institue of Technology Bombay Computer Science and Engineering Indian Institue of Technology Bombay November 27, 2004 What is Object Oriented Programming? Identifying objects and assigning responsibilities to these objects. Objects

More information

Day 4. COMP1006/1406 Summer M. Jason Hinek Carleton University

Day 4. COMP1006/1406 Summer M. Jason Hinek Carleton University Day 4 COMP1006/1406 Summer 2016 M. Jason Hinek Carleton University today s agenda assignments questions about assignment 2 a quick look back constructors signatures and overloading encapsulation / information

More information

Object-oriented programming. and data-structures CS/ENGRD 2110 SUMMER 2018

Object-oriented programming. and data-structures CS/ENGRD 2110 SUMMER 2018 Object-oriented programming 1 and data-structures CS/ENGRD 2110 SUMMER 2018 Lecture 4: OO Principles - Polymorphism http://courses.cs.cornell.edu/cs2110/2018su Lecture 3 Recap 2 Good design principles.

More information

Object-Oriented Programming Design and Analysis Elena Punskaya,

Object-Oriented Programming Design and Analysis Elena Punskaya, Object-Oriented Programming Design and Analysis Elena Punskaya, op205@cam.ac.uk!1 Object-Oriented Programming First programs: anything goes! 1960s-1970s: structured programming! - any computable function

More information

Introduction to Computers and Java

Introduction to Computers and Java Introduction to Computers and Java Chapter 1 Chapter 1 1 Objectives overview computer hardware and software introduce program design and object-oriented programming overview the Java programming language

More information

Get Unique study materials from

Get Unique study materials from Downloaded from www.rejinpaul.com VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur 603203. DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year & Semester : IV Section : EEE - 1 & 2 Subject Code

More information

JAVA: A Primer. By: Amrita Rajagopal

JAVA: A Primer. By: Amrita Rajagopal JAVA: A Primer By: Amrita Rajagopal 1 Some facts about JAVA JAVA is an Object Oriented Programming language (OOP) Everything in Java is an object application-- a Java program that executes independently

More information

Topics in Object-Oriented Design Patterns

Topics in Object-Oriented Design Patterns Software design Topics in Object-Oriented Design Patterns Material mainly from the book Design Patterns by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides; slides originally by Spiros Mancoridis;

More information

Object-Oriented Programming (OOP) Fundamental Principles of OOP

Object-Oriented Programming (OOP) Fundamental Principles of OOP Object-Oriented Programming (OOP) O b j e c t O r i e n t e d P r o g r a m m i n g 1 Object-oriented programming is the successor of procedural programming. The problem with procedural programming is

More information

Inheritance, and Polymorphism.

Inheritance, and Polymorphism. Inheritance and Polymorphism by Yukong Zhang Object-oriented programming languages are the most widely used modern programming languages. They model programming based on objects which are very close to

More information

The 10 Minute Guide to Object Oriented Programming

The 10 Minute Guide to Object Oriented Programming The 10 Minute Guide to Object Oriented Programming Why read this? Because the main concepts of object oriented programming (or OOP), often crop up in interviews, and all programmers should be able to rattle

More information

Introducing the UML Eng. Mohammed T. Abo Alroos

Introducing the UML Eng. Mohammed T. Abo Alroos Introducing the UML Eng. Mohammed T. Abo Alroos Islamic University of Gaza Introduction to the UML: The UML stands for Unified Modeling Language. It was released in 1997 as a method to diagram software

More information

Contents. I. Classes, Superclasses, and Subclasses. Topic 04 - Inheritance

Contents. I. Classes, Superclasses, and Subclasses. Topic 04 - Inheritance Contents Topic 04 - Inheritance I. Classes, Superclasses, and Subclasses - Inheritance Hierarchies Controlling Access to Members (public, no modifier, private, protected) Calling constructors of superclass

More information

What is Polymorphism? Quotes from Deitel & Deitel s. Why polymorphism? How? How? Polymorphism Part 1

What is Polymorphism? Quotes from Deitel & Deitel s. Why polymorphism? How? How? Polymorphism Part 1 Polymorphism Part 1 What is Polymorphism? Polymorphism refers to a programming language s ability to process objects differently depending on their data type or class. Number person real complex kid adult

More information

Programming, numerics and optimization

Programming, numerics and optimization Programming, numerics and optimization Lecture A-4: Object-oriented programming Łukasz Jankowski ljank@ippt.pan.pl Institute of Fundamental Technological Research Room 4.32, Phone +22.8261281 ext. 428

More information

Increases Program Structure which results in greater reliability. Polymorphism

Increases Program Structure which results in greater reliability. Polymorphism UNIT 4 C++ Inheritance What is Inheritance? Inheritance is the process by which new classes called derived classes are created from existing classes called base classes. The derived classes have all the

More information

Lecture 6 Introduction to Objects and Classes

Lecture 6 Introduction to Objects and Classes Lecture 6 Introduction to Objects and Classes Outline Basic concepts Recap Computer programs Programming languages Programming paradigms Object oriented paradigm-objects and classes in Java Constructors

More information

Chapter 6 Introduction to Defining Classes

Chapter 6 Introduction to Defining Classes Introduction to Defining Classes Fundamentals of Java: AP Computer Science Essentials, 4th Edition 1 Objectives Design and implement a simple class from user requirements. Organize a program in terms of

More information

Java Object Oriented Design. CSC207 Fall 2014

Java Object Oriented Design. CSC207 Fall 2014 Java Object Oriented Design CSC207 Fall 2014 Design Problem Design an application where the user can draw different shapes Lines Circles Rectangles Just high level design, don t write any detailed code

More information

Inheritance and Polymorphism

Inheritance and Polymorphism Object Oriented Programming Designed and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. Al-Azhar University Website: eaymanelshenawy.wordpress.com Email : eaymanelshenawy@azhar.edu.eg

More information