Course Overview 1 CS3391 - Object Oriented Programming
• To understand Object Oriented Programming concepts and basic characteristics of Java Programming language. • To know the principles of packages, inheritance and interfaces. • To develop a java application with threads and generic classes. • To define exceptions and use I/O Streams. • To design and build Graphical User Interface Application using JAVAFX. 2 Course Objective
• Apply the concepts of classes and objects to solve simple problems. • Develop programs using inheritance, packages and interfaces. • Make use of exception handling mechanisms and multithreaded model to solve real world problems. • Build Java applications with I/O packages, string classes, Collections and generics concepts. • Integrate the concepts of event handling and JavaFX components and controls for developing GUI based applications. 3 Course Outcome
COURSE SYLLABUS 4 Course Syllabus
• Herbert Schildt, ―Java The complete reference, 11th Edition, McGraw Hill Education, 2019. • Herbert Schildt, “Introducing JavaFX 8 Programming”, 1 st Edition, McGraw Hill Education, 2015. 5 Text Books
• Cay S. Horstmann, “Core Java Fundamentals”, Volume 1, 11 th Edition, Prentice Hall, 2018. 6 Reference Books
CS8392 - Object Oriented Programming Unit I Introduction to OOP and Java Fundamentals
Object Oriented Programming - Abstraction – objects and classes - Encapsulation- Inheritance-Polymorphism- OOP in Java – Characteristics of Java – The Java Environment - Java Source File - Structure Compilation. Fundamental Programming Structures in Java – Defining classes in Java – constructors, methods - access specifiers - static members - Comments, Data Types, Variables, Operators, Control Flow, Arrays, Packages - JavaDoc comments. 8 Unit I: Syllabus
• A Programming paradigm is a framework that define how the user conceptualized and interpret complex problems. Simply, it is a style, or “way,” of programming. • A programming paradigm defines the methodology of designing and implementing programs using the key features and building blocks of a programming language. 9 Programming Paradigm: Overview
• Two major types of Programming Paradigm are as follows: 10 Programming Paradigm: Overview
• Imperative programming paradigm – It works by changing the program state through assignment statements. It performs step by step task by changing state. The main focus is on how to achieve the goal. – Programming with an explicit sequence of commands that update state. • Declarative programming paradigm – Programming is a style of building programs that expresses logic of computation without talking about its control flow. – The focus is on what needs to be done rather how it should be done basically emphasize on what code is actually doing. It just declare the result we want rather how it has be produced. • Difference: – imperative (how to do) – declarative (what to do). 11 Programming Paradigm: Overview
The three primary types of Programming Paradigm are as follows: • Unstructured Programming – The most primitive of all programming languages having sequentially flow of control. – Code is repeated through out the program • Structured Programming or Procedural Oriented Programming – Has non-sequentially flow of control. – Use of functions allows for re-use of code. • Object Oriented Programming – Combines Data & Action Together. 12 Programming Paradigm: Overview
Unstructured Programming • The program consists of only one section i.e.., main • Main consists of a sequence of commands or statements which modify data which is global throughout the whole program. • Example: BASIC,COBOL Advantages • Simple and easy to practice by novice programmer • Good for small program; no lengthy planning needed. 13 Programming Paradigm: Overview
Unstructured Programming Disadvantages • Repetition of code • If the same statement sequence is needed at the different locations within the program, the sequence must be copied. • Cumbersome Maintenance • When a certain statement is changed, all subsequent affected statements must be adjusted accordingly. 14 Programming Paradigm: Overview
Procedural or Structured programming • This programming paradigm aimed at improving the clarity, quality, and development time of a computer program by making extensive use of the structured control flow constructs of selection (if/then/else) and repetition (while and for), block structures, and subroutines. • In Procedural Programming, the problem is bifurcated into number of small problems known as procedures (Also alternatively referred as functions or methods). • Each of these procedures provide solution to part of the problem. 15 Programming Paradigm: Overview
Procedural or Structured programming • Use top down approach (General to Specific) – In top-down approach the total system is divided into number of sub systems and those sub systems are again divided into number of other sub systems. It goes until the base level elements are defined properly. – So the top-down approach starts with the big picture and breaks down from there to smaller segments. 16 Programming Paradigm: Overview
Procedural or Structured programming Advantages • Complexity can be reduced using the concepts of divide and conquer. • Logical structures ensure clear flow of control. • Increase in productivity by allowing multiple programmers to work on different parts of the project independently at the same time. • Modules can be re-used many times, thus it saves time, reduces complexity and increase reliability. • Easier to update/fix the program by replacing individual modules rather than larger amount of code. 17 Programming Paradigm: Overview
Procedural or Structured programming Disadvantages • Same code repetition • Lack of information hiding • Not much reusability of code. • Can support the software development projects easily up to a certain level of complexity. If complexity of the project goes beyond a limit, it becomes difficult to manage and not possible to represent as a single problem. • Change of even a single data structure in a program necessitates changes at many places throughout it, and hence the changes becomes very difficult to track even in a reasonable sized program. 18 Programming Paradigm: Overview
Object Oriented Programming • Object Oriented programming (OOP) is a programming language model organized around objects rather than "actions" and data rather than logic. • The main aim of OOP is to bind together the data and the functions that operate on them so that no other part of the code can access this data except that function. 19 Programming Paradigm: Overview
Why Object-oriented programming? • An object-oriented programming is a way of programming which enables programmers to think like they are working with real-life entities or objects. • In real-life, people have knowledge and can do various works. – In OOP, objects have fields to store knowledge/state/data and can do various works in the form of methods. 20 Programming Paradigm: Overview
21 Programming Paradigm: Overview Procedural Vs. OOP Procedural OOP
Procedural Vs. OOP 22 Programming Paradigm: Overview
Unstructured Vs. Structured Vs. OOP Programming Unstructured Structured OOPS 23 Programming Paradigm: Overview
24 OOPs Concepts
• Object is the key to understanding object- oriented programming paradigm. • Object means a real-world entity such as a pen, chair, table, computer, watch, etc. • Example: 25 OOPs: Object
An object has three characteristics: • State: represents the data (value) of an object. • Behavior: represents the behavior (functionality) of an object such as deposit, withdraw, etc. • Identity: Each object has a unique identity that can be used to distinguish it from other objects. – Two objects may exhibit the same behaviour and they may or may not have the same state, but they never have the same identity. 26 OOPs: Object
27 OOPs: Object Example: Dog Object Person Object
Identify the state, behavior, and Identity of the following given objects 28 OOPs: Object Exercise:1
• Class is a group of objects with similar properties, common behaviour, common relationships with other objects, and common semantics. • A class is the template / blueprint from which individual objects are created. 29 For Example: • Each car was built from the same set of blueprints and therefore contains the same components. • In object-oriented terms, we say that your car is an instance of the class of objects known as cars. OOPs: Class
30 OOPs: Class
31 Instance of Class Dog OOPs: Class
Properties and behavior of Customer Class 32 OOPs: Class
• Data abstraction refers to providing only relevant/essential information about the data to the outside world, hiding the irrelevant/background details/implementation. • For Example: – when you send an email to someone you just click send and you get the success message, what actually happens when you click send, how data is transmitted over network to the recipient is hidden from you (because it is irrelevant to you).33 OOPs: Abstraction
34 OOPs: Abstraction Example: Note: An abstraction includes the essential details relative to the perspective of the user.
Example: 35 • Drivers interact with car using pedals, buttons, etc. • Mechanic can test that engine control module sends the right firing signals to the spark plugs • For engine control module manufacturers, transistors and capacitors are black boxes magically produced by an electronics component OOPs: Abstraction
• Encapsulation simply means binding object state(fields) and behavior(methods) together. It is achieved by class concept. • It is defined as the process of enclosing one or more details from outside world through access right. • It says how much access should be given to particular details. It is also known as “data Hiding“. 36 OOPs: Encapsulation
• Both Abstraction & Encapsulation works hand in hand because, – Abstraction says what details to be made visible – Encapsulation provides the level of access right to that visible details. i.e. It implements the desired level of abstraction. 37 OOPs: Encapsulation
38 • Inheritance is a process in which one object acquires all the properties and behaviours of its parent object automatically. • The class which inherits the members of another class is called derived class and the class whose members are inherited is called base class. • The aim of inheritance is to provide the reusability of code. OOPs: Inheritance
39 OOPs: Inheritance
• Polymorphism means having many forms. • In simple words, we can define polymorphism as the ability of an object behaves differently in different situations. 40 OOPs: Polymorphism
• Example 1: we are turn on the computer by one button at the same time we can turn off the computer by the same button. • Example 2: A person at the same time can have different characteristic. Like a man at the same time is a Child, a Grand Child, a Student, an Friend. So the same person posses different behaviour in different situations. 41 OOPs: Polymorphism
Advantages • Reusability: ”write once and use it multiple times”. • Redundancy: Inheritance is the good feature for data redundancy. ₋ If you need a same functionality in multiple class you can write a common class for the same functionality and inherit that class to sub class. • Easy Maintenance: It is easy to maintain and modify existing code as new objects can be created with small differences to existing ones. • Security: Using data hiding and abstraction only necessary data will be provided thus maintains the security of data. 42 OOPs: Advantages
• Object oriented and Object based programming languages have some different features and behaviour Object oriented language – Object-oriented language supports all the features of OOPs. – Object-oriented language doesn't has in-built object. – Object-oriented languages are C++, C#, Java, Python, PHP etc. Object based language – Object-based language doesn't support all the features of OOPs like Polymorphism and Inheritance – Object-based language has in-built object like JavaScript has window object. – Object-based languages are JavaScript, VB etc. 43 OOP Vs OBS
OOPs Concepts Overview: (Consider Television Example) 44 OOPs: Overview
Read the below scenario and Identify equivalent OOPs Concept: 3.1 A Person who knows more than two languages, but he can speak in a language which he knows according to the situation. 3.2 A scientific calculator is a extend form of Calculator. 3.3 When you go to a bank, and tell the banker(Object) to make a deposit(Method) of X dollars into your account(object), but to do so the banker request’s you to give him your account number and the amount of cash you wish to deposit. Shortly after a few minutes the banker tell’s you. Hey! your deposit has been made correctly and here is your receipt. 45 OOPs Concepts Exercise:3
4.1 Think of a mobile phone as an object, its basic functionality for which it was invented were Calling & Receiving a call & Messaging. But now a days thousands of new features and models were added and the features and number of models are still growing. • Find out the class and objects for the above scenario. Also try to visualize how abstraction, encapsulation, inheritance and polymorphism will be achieved. 46 OOPs Concepts Exercise:4
47 Quiz 1) How many objects can you identify in the below picture? d) 8 c) 4 a) 16 b) 2 Answer : Option a) QUIZ
48 Quiz 2) How many types of objects can you identify in the below picture? d) 8 c) 4 a) 16 b) 2 Answer : Option b) QUIZ
49 Quiz 3) Is sound an object? 4) Is light an object? a) Yes b) No a) Yes b) No Answer : Option a) Answer : Option a) QUIZ
50 Quiz 5) Which of the following statement is correct? 6) Which of the following concepts means wrapping up of data and functions together? Answer : Option b) d) Object is an instance of data type. c) Class is an instance of data type. a) Class is an instance of object. b) Object is an instance of a class. QUIZ d) POLYMORPHISM c) INHERITANCE a) ABSTRACTION b) ENCAPSULATION Answer : Option b)
51 Quiz 7) A _____ is a template or blueprint from which objects can be instantiated from. 8) A ___________ is a subroutine defined within a class to implement a behavior. a) CLASS b) OBJECT Answer : Option a) QUIZ d) CONSTRUCTOR c) METHOD a) OBJECT b) CLASS Answer : Option c)
52 Quiz 9) Which of the following concepts means when a sub-class inherits the methods and properties of a parent class. 10)Which of the following concepts of OOPS means exposing only necessary information to client? d) POLYMORPHISM c) INHERITANCE a) ABSTRACTION b) ENCAPSULATION Answer : Option c) QUIZ d) POLYMORPHISM c) INHERITANCE a) ABSTRACTION b) ENCAPSULATION Answer : Option a)
Possible Questions: 2 Marks 1. Differentiate Procedural Programming and OOP. 2. What are the core concepts of OOPS? 3. Why we use OOPS? 4. Define object. 5. Define class. 6. What is the difference between abstraction and encapsulation? 7. Define encapsulation. 8. What is inheritance? 9. Define polymorphism. 53 Introduction to OOPs
Possible Questions: 16 Marks 1. Differentiate Procedural programming and OOP. 2. Discuss the OOP principles in detail. 3. Explain the characteristics of OOPs. 4. Compare Structure or Procedural oriented and Object Oriented Programming Paradigm 54 Introduction to OOPs
Anna university Questions: 2 Marks: 1. Define objects and classes in java.(Nov/Dec 2018) 16 Marks: 2. Discuss the three OOP Principles in detail.(7) (Apr/May 2019) 3. Explain the characteristics of OOPS(6) (Nov/Dec 2018) 55 OOPs: Questions

Object Oriented Programming Part 2 of Unit 1

  • 1.
    Course Overview 1 CS3391 -Object Oriented Programming
  • 2.
    • To understandObject Oriented Programming concepts and basic characteristics of Java Programming language. • To know the principles of packages, inheritance and interfaces. • To develop a java application with threads and generic classes. • To define exceptions and use I/O Streams. • To design and build Graphical User Interface Application using JAVAFX. 2 Course Objective
  • 3.
    • Apply theconcepts of classes and objects to solve simple problems. • Develop programs using inheritance, packages and interfaces. • Make use of exception handling mechanisms and multithreaded model to solve real world problems. • Build Java applications with I/O packages, string classes, Collections and generics concepts. • Integrate the concepts of event handling and JavaFX components and controls for developing GUI based applications. 3 Course Outcome
  • 4.
  • 5.
    • Herbert Schildt,―Java The complete reference, 11th Edition, McGraw Hill Education, 2019. • Herbert Schildt, “Introducing JavaFX 8 Programming”, 1 st Edition, McGraw Hill Education, 2015. 5 Text Books
  • 6.
    • Cay S.Horstmann, “Core Java Fundamentals”, Volume 1, 11 th Edition, Prentice Hall, 2018. 6 Reference Books
  • 7.
    CS8392 - ObjectOriented Programming Unit I Introduction to OOP and Java Fundamentals
  • 8.
    Object Oriented Programming- Abstraction – objects and classes - Encapsulation- Inheritance-Polymorphism- OOP in Java – Characteristics of Java – The Java Environment - Java Source File - Structure Compilation. Fundamental Programming Structures in Java – Defining classes in Java – constructors, methods - access specifiers - static members - Comments, Data Types, Variables, Operators, Control Flow, Arrays, Packages - JavaDoc comments. 8 Unit I: Syllabus
  • 9.
    • A Programmingparadigm is a framework that define how the user conceptualized and interpret complex problems. Simply, it is a style, or “way,” of programming. • A programming paradigm defines the methodology of designing and implementing programs using the key features and building blocks of a programming language. 9 Programming Paradigm: Overview
  • 10.
    • Two majortypes of Programming Paradigm are as follows: 10 Programming Paradigm: Overview
  • 11.
    • Imperative programmingparadigm – It works by changing the program state through assignment statements. It performs step by step task by changing state. The main focus is on how to achieve the goal. – Programming with an explicit sequence of commands that update state. • Declarative programming paradigm – Programming is a style of building programs that expresses logic of computation without talking about its control flow. – The focus is on what needs to be done rather how it should be done basically emphasize on what code is actually doing. It just declare the result we want rather how it has be produced. • Difference: – imperative (how to do) – declarative (what to do). 11 Programming Paradigm: Overview
  • 12.
    The three primarytypes of Programming Paradigm are as follows: • Unstructured Programming – The most primitive of all programming languages having sequentially flow of control. – Code is repeated through out the program • Structured Programming or Procedural Oriented Programming – Has non-sequentially flow of control. – Use of functions allows for re-use of code. • Object Oriented Programming – Combines Data & Action Together. 12 Programming Paradigm: Overview
  • 13.
    Unstructured Programming • Theprogram consists of only one section i.e.., main • Main consists of a sequence of commands or statements which modify data which is global throughout the whole program. • Example: BASIC,COBOL Advantages • Simple and easy to practice by novice programmer • Good for small program; no lengthy planning needed. 13 Programming Paradigm: Overview
  • 14.
    Unstructured Programming Disadvantages • Repetitionof code • If the same statement sequence is needed at the different locations within the program, the sequence must be copied. • Cumbersome Maintenance • When a certain statement is changed, all subsequent affected statements must be adjusted accordingly. 14 Programming Paradigm: Overview
  • 15.
    Procedural or Structuredprogramming • This programming paradigm aimed at improving the clarity, quality, and development time of a computer program by making extensive use of the structured control flow constructs of selection (if/then/else) and repetition (while and for), block structures, and subroutines. • In Procedural Programming, the problem is bifurcated into number of small problems known as procedures (Also alternatively referred as functions or methods). • Each of these procedures provide solution to part of the problem. 15 Programming Paradigm: Overview
  • 16.
    Procedural or Structuredprogramming • Use top down approach (General to Specific) – In top-down approach the total system is divided into number of sub systems and those sub systems are again divided into number of other sub systems. It goes until the base level elements are defined properly. – So the top-down approach starts with the big picture and breaks down from there to smaller segments. 16 Programming Paradigm: Overview
  • 17.
    Procedural or Structuredprogramming Advantages • Complexity can be reduced using the concepts of divide and conquer. • Logical structures ensure clear flow of control. • Increase in productivity by allowing multiple programmers to work on different parts of the project independently at the same time. • Modules can be re-used many times, thus it saves time, reduces complexity and increase reliability. • Easier to update/fix the program by replacing individual modules rather than larger amount of code. 17 Programming Paradigm: Overview
  • 18.
    Procedural or Structuredprogramming Disadvantages • Same code repetition • Lack of information hiding • Not much reusability of code. • Can support the software development projects easily up to a certain level of complexity. If complexity of the project goes beyond a limit, it becomes difficult to manage and not possible to represent as a single problem. • Change of even a single data structure in a program necessitates changes at many places throughout it, and hence the changes becomes very difficult to track even in a reasonable sized program. 18 Programming Paradigm: Overview
  • 19.
    Object Oriented Programming •Object Oriented programming (OOP) is a programming language model organized around objects rather than "actions" and data rather than logic. • The main aim of OOP is to bind together the data and the functions that operate on them so that no other part of the code can access this data except that function. 19 Programming Paradigm: Overview
  • 20.
    Why Object-oriented programming? •An object-oriented programming is a way of programming which enables programmers to think like they are working with real-life entities or objects. • In real-life, people have knowledge and can do various works. – In OOP, objects have fields to store knowledge/state/data and can do various works in the form of methods. 20 Programming Paradigm: Overview
  • 21.
  • 22.
  • 23.
    Unstructured Vs. StructuredVs. OOP Programming Unstructured Structured OOPS 23 Programming Paradigm: Overview
  • 24.
  • 25.
    • Object isthe key to understanding object- oriented programming paradigm. • Object means a real-world entity such as a pen, chair, table, computer, watch, etc. • Example: 25 OOPs: Object
  • 26.
    An object hasthree characteristics: • State: represents the data (value) of an object. • Behavior: represents the behavior (functionality) of an object such as deposit, withdraw, etc. • Identity: Each object has a unique identity that can be used to distinguish it from other objects. – Two objects may exhibit the same behaviour and they may or may not have the same state, but they never have the same identity. 26 OOPs: Object
  • 27.
  • 28.
    Identify the state,behavior, and Identity of the following given objects 28 OOPs: Object Exercise:1
  • 29.
    • Class isa group of objects with similar properties, common behaviour, common relationships with other objects, and common semantics. • A class is the template / blueprint from which individual objects are created. 29 For Example: • Each car was built from the same set of blueprints and therefore contains the same components. • In object-oriented terms, we say that your car is an instance of the class of objects known as cars. OOPs: Class
  • 30.
  • 31.
  • 32.
    Properties and behaviorof Customer Class 32 OOPs: Class
  • 33.
    • Data abstractionrefers to providing only relevant/essential information about the data to the outside world, hiding the irrelevant/background details/implementation. • For Example: – when you send an email to someone you just click send and you get the success message, what actually happens when you click send, how data is transmitted over network to the recipient is hidden from you (because it is irrelevant to you).33 OOPs: Abstraction
  • 34.
    34 OOPs: Abstraction Example: Note: Anabstraction includes the essential details relative to the perspective of the user.
  • 35.
    Example: 35 • Drivers interactwith car using pedals, buttons, etc. • Mechanic can test that engine control module sends the right firing signals to the spark plugs • For engine control module manufacturers, transistors and capacitors are black boxes magically produced by an electronics component OOPs: Abstraction
  • 36.
    • Encapsulation simplymeans binding object state(fields) and behavior(methods) together. It is achieved by class concept. • It is defined as the process of enclosing one or more details from outside world through access right. • It says how much access should be given to particular details. It is also known as “data Hiding“. 36 OOPs: Encapsulation
  • 37.
    • Both Abstraction& Encapsulation works hand in hand because, – Abstraction says what details to be made visible – Encapsulation provides the level of access right to that visible details. i.e. It implements the desired level of abstraction. 37 OOPs: Encapsulation
  • 38.
    38 • Inheritance isa process in which one object acquires all the properties and behaviours of its parent object automatically. • The class which inherits the members of another class is called derived class and the class whose members are inherited is called base class. • The aim of inheritance is to provide the reusability of code. OOPs: Inheritance
  • 39.
  • 40.
    • Polymorphism meanshaving many forms. • In simple words, we can define polymorphism as the ability of an object behaves differently in different situations. 40 OOPs: Polymorphism
  • 41.
    • Example 1:we are turn on the computer by one button at the same time we can turn off the computer by the same button. • Example 2: A person at the same time can have different characteristic. Like a man at the same time is a Child, a Grand Child, a Student, an Friend. So the same person posses different behaviour in different situations. 41 OOPs: Polymorphism
  • 42.
    Advantages • Reusability: ”writeonce and use it multiple times”. • Redundancy: Inheritance is the good feature for data redundancy. ₋ If you need a same functionality in multiple class you can write a common class for the same functionality and inherit that class to sub class. • Easy Maintenance: It is easy to maintain and modify existing code as new objects can be created with small differences to existing ones. • Security: Using data hiding and abstraction only necessary data will be provided thus maintains the security of data. 42 OOPs: Advantages
  • 43.
    • Object orientedand Object based programming languages have some different features and behaviour Object oriented language – Object-oriented language supports all the features of OOPs. – Object-oriented language doesn't has in-built object. – Object-oriented languages are C++, C#, Java, Python, PHP etc. Object based language – Object-based language doesn't support all the features of OOPs like Polymorphism and Inheritance – Object-based language has in-built object like JavaScript has window object. – Object-based languages are JavaScript, VB etc. 43 OOP Vs OBS
  • 44.
    OOPs Concepts Overview:(Consider Television Example) 44 OOPs: Overview
  • 45.
    Read the belowscenario and Identify equivalent OOPs Concept: 3.1 A Person who knows more than two languages, but he can speak in a language which he knows according to the situation. 3.2 A scientific calculator is a extend form of Calculator. 3.3 When you go to a bank, and tell the banker(Object) to make a deposit(Method) of X dollars into your account(object), but to do so the banker request’s you to give him your account number and the amount of cash you wish to deposit. Shortly after a few minutes the banker tell’s you. Hey! your deposit has been made correctly and here is your receipt. 45 OOPs Concepts Exercise:3
  • 46.
    4.1 Think ofa mobile phone as an object, its basic functionality for which it was invented were Calling & Receiving a call & Messaging. But now a days thousands of new features and models were added and the features and number of models are still growing. • Find out the class and objects for the above scenario. Also try to visualize how abstraction, encapsulation, inheritance and polymorphism will be achieved. 46 OOPs Concepts Exercise:4
  • 47.
    47 Quiz 1) How manyobjects can you identify in the below picture? d) 8 c) 4 a) 16 b) 2 Answer : Option a) QUIZ
  • 48.
    48 Quiz 2) How manytypes of objects can you identify in the below picture? d) 8 c) 4 a) 16 b) 2 Answer : Option b) QUIZ
  • 49.
    49 Quiz 3) Is soundan object? 4) Is light an object? a) Yes b) No a) Yes b) No Answer : Option a) Answer : Option a) QUIZ
  • 50.
    50 Quiz 5) Which ofthe following statement is correct? 6) Which of the following concepts means wrapping up of data and functions together? Answer : Option b) d) Object is an instance of data type. c) Class is an instance of data type. a) Class is an instance of object. b) Object is an instance of a class. QUIZ d) POLYMORPHISM c) INHERITANCE a) ABSTRACTION b) ENCAPSULATION Answer : Option b)
  • 51.
    51 Quiz 7) A _____is a template or blueprint from which objects can be instantiated from. 8) A ___________ is a subroutine defined within a class to implement a behavior. a) CLASS b) OBJECT Answer : Option a) QUIZ d) CONSTRUCTOR c) METHOD a) OBJECT b) CLASS Answer : Option c)
  • 52.
    52 Quiz 9) Which ofthe following concepts means when a sub-class inherits the methods and properties of a parent class. 10)Which of the following concepts of OOPS means exposing only necessary information to client? d) POLYMORPHISM c) INHERITANCE a) ABSTRACTION b) ENCAPSULATION Answer : Option c) QUIZ d) POLYMORPHISM c) INHERITANCE a) ABSTRACTION b) ENCAPSULATION Answer : Option a)
  • 53.
    Possible Questions: 2 Marks 1.Differentiate Procedural Programming and OOP. 2. What are the core concepts of OOPS? 3. Why we use OOPS? 4. Define object. 5. Define class. 6. What is the difference between abstraction and encapsulation? 7. Define encapsulation. 8. What is inheritance? 9. Define polymorphism. 53 Introduction to OOPs
  • 54.
    Possible Questions: 16 Marks 1.Differentiate Procedural programming and OOP. 2. Discuss the OOP principles in detail. 3. Explain the characteristics of OOPs. 4. Compare Structure or Procedural oriented and Object Oriented Programming Paradigm 54 Introduction to OOPs
  • 55.
    Anna university Questions: 2Marks: 1. Define objects and classes in java.(Nov/Dec 2018) 16 Marks: 2. Discuss the three OOP Principles in detail.(7) (Apr/May 2019) 3. Explain the characteristics of OOPS(6) (Nov/Dec 2018) 55 OOPs: Questions