CPRG 215 Introduction to Object-Oriented Programming with Java Module 3- Introduction to Object Oriented Programming concepts Topic 3.1 Fundamental Concepts.

Slides:



Advertisements
Similar presentations
Programming Paradigms Introduction. 6/15/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved. L1:
Advertisements

Department of Computer Engineering Faculty of Engineering, Prince of Songkla University 1 5 – Abstract Data Types.
Fundamentals of Web DevelopmentRandy Connolly and Ricardo HoarFundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy.
OBJECT ORIENTED PROGRAMMING M Taimoor Khan
ITEC200 – Week03 Inheritance and Class Hierarchies.
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
OOP in Java Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
BACS 287 Basics of Object-Oriented Programming 1.
Object Oriented Programming
2.5 OOP Principles Part 1 academy.zariba.com 1. Lecture Content 1.Fundamental Principles of OOP 2.Inheritance 3.Abstraction 4.Encapsulation 2.
1 Using Classes Object-Oriented Programming Using C++ Second Edition 5.
Programming Languages and Paradigms Object-Oriented Programming.
CSM-Java Programming-I Spring,2005 Introduction to Objects and Classes Lesson - 1.
Eclipse – making OOP Easy
Object Orientation An Object oriented approach views systems and programs as a collection of interacting objects. An object is a thing in a computer system.
MT311 Java Application Development and Programming Languages Li Tak Sing( 李德成 )
Chapter 8 More Object Concepts
An Object-Oriented Approach to Programming Logic and Design
OBJECT ORIENTED PROGRAMMING CONCEPTS ISC 560. Object-oriented Concepts  Objects – things names with nouns  Classes – classifications (groups) of similar.
Object Oriented Programming: Java Edition By: Samuel Robinson.
CPRG 215 Introduction to Object-Oriented Programming with Java Module 1-Introduction to Java Topic 1.2 Getting the Tools and Setting Up the Development.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Programming Languages and Paradigms Object-Oriented Programming.
Selected Topics in Information Technology Programming Language - JAVA Semester 1/2554.
CPRG 215 Introduction to Object-Oriented Programming with Java Module 1-Introduction to Java Topic 1.1 Basics of Java Produced by Harvey Peters, 2008 Copyright.
Software Development. Software Developers Refresher A person or organization that designs software and writes the programs. Software development is the.
Chapter 12 Support for Object oriented Programming.
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
CPRG 215 Introduction to Object-Oriented Programming with Java Module 3- Introduction to Object Oriented Programming concepts Topic 3.6 Access Modifiers,
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 5 Creating Classes.
Chapter 12 Support for Object-Oriented Programming.
Object-Oriented Programming Chapter Chapter
(1) ICS 313: Programming Language Theory Chapter 12: Object Oriented Programming.
OOPs Object oriented programming. Abstract data types  Representationof type and operations in a single unit  Available for other units to create variables.
Final Review. From ArrayLists to Arrays The ArrayList : used to organize a list of objects –It is a class in the Java API –the ArrayList class uses an.
ISBN Object-Oriented Programming Chapter Chapter
Introduction to Object-Oriented Programming Lesson 2.
CPRG 215 Introduction to Object-Oriented Programming with Java Module 4- Exception and Error Handling Topic 4.1 Errors and Exceptions Produced by Harvey.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
CPRG 215 Introduction to Object-Oriented Programming with Java Module 3- Introduction to Object Oriented Programming concepts Topic 3.4 Constructors, Overloading,
CPRG 215 Introduction to Object-Oriented Programming with Java Module 1-Introduction to Java Topic 1.3 Write Your First Java Program Produced by Harvey.
Quick Review of OOP Constructs Classes:  Data types for structured data and behavior  fields and methods Objects:  Variables whose data type is a class.
Object Oriented Programming. OOP  The fundamental idea behind object-oriented programming is:  The real world consists of objects. Computer programs.
CPRG 215 Introduction to Object-Oriented Programming with Java Module 2- Using Java Built-in Classes Topic 2.6 Reading Input with java.io Produced by Harvey.
CSCI 171 Presentation 15 Introduction to Object–Oriented Programming (OOP) in C++
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
ISBN Chapter 12 Support for Object-Oriented Programming.
Chapter 12: Support for Object- Oriented Programming Lecture # 18.
Chapter 11: Abstract Data Types Lecture # 17. Chapter 11 Topics The Concept of Abstraction Advantages of Abstract Data Types Design Issues for Abstract.
Object-Oriented Programming Using C++ Third Edition Chapter 7 Using Classes.
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
Object-Oriented Design
Objects as a programming concept
The Object-Oriented Thought Process Chapter 1
COMPUTER 2430 Object Oriented Programming and Data Structures I
Chapter 3: Using Methods, Classes, and Objects
8/30/2018 CPRG 215 Introduction to Object-Oriented Programming with Java Module 5- The java.io Package Topic 5.1 Input and Output Streams, Readers.
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
Section 11.1 Class Variables and Methods
Object Oriented Concepts
Object-Oriented Programming Using C++
Inheritance Basics Programming with Inheritance
Parameter Passing Actual vs formal parameters
Computer Programming with JAVA
Java Programming, Second Edition
Support for Object-Oriented Programming
Introduction to Data Structure
Object-Oriented Programming Using C++
Object Oriented Design & Analysis
Chapter 11 Abstraction - The concept of abstraction is fundamental in
Presentation transcript:

CPRG 215 Introduction to Object-Oriented Programming with Java Module 3- Introduction to Object Oriented Programming concepts Topic 3.1 Fundamental Concepts Produced by Harvey Peters, 2008 Copyright SAIT

Please review the following sections in your textbook Core Java, Volume I–Fundamentals, Eighth Edition By Cay S. Horstmann & Gary Cornell Chapter 4 - Objects and Classes Introduction to Object-Oriented Programming Using Predefined Classes Defining Your Own Classes Static Fields and Methods Method Parameters CPRG 215 Module 3.1- Fundamental Concepts Copyright SAIT

Introduction to Objects History –variables treated as isolated values –led to the need for many variable names in code –ignores associations between variables year, month, day -- all part of date –Code required to work with the data was duplicated in every program that used the data, and often varied from one program to another Topic CPRG 215 Module 3.1- Fundamental Concepts Copyright SAIT

Introduction to Objects Object is a container for data and the logic that is needed to maintain the data Objects correspond to actual things that people use in their work Methods correspond to actual tasks that are done to store and maintain data used in the work Topic CPRG 215 Module 3.1- Fundamental Concepts Copyright SAIT

Instantiating Objects Creating an Object –Declaring primitive types allocates memory space int x; –Declaring nonprimitive (object) types does not allocate memory space MyObject newobj1; –Declared variables are not the data itself, but references (or pointers) to the object that contains the data Topic CPRG 215 Module 3.1- Fundamental Concepts Copyright SAIT

Instantiating Objects Instantiation (creating an instance): –Before using the variable we must allocate the storage space MyDate myBirthday; myBirthday = new MyDate(); –What this means is: given a class Xxxx, we can call “new Xxxx()” to create as many objects as we need, each with its own memory space Class Instantiation Object Topic CPRG 215 Module 3.1- Fundamental Concepts Copyright SAIT

Object Orientation Theory Key features of OOP languages –Abstraction –Encapsulation –Polymorphism –Inheritance Topic CPRG 215 Module 3.1- Fundamental Concepts Copyright SAIT

Object Orientation Theory Abstraction –Identify the common features of a group of objects and build a class –Create subclasses to add-on specialized features Topic CPRG 215 Module 3.1- Fundamental Concepts Copyright SAIT

Object Orientation Theory Encapsulation –hides the implementation details (internal operations) of a class –forces the user to use an interface to access data (like a doorway) –Data Hiding public vs. private access –You can’t help yourself to private data, but you can ask a public method for it Topic CPRG 215 Module 3.1- Fundamental Concepts Copyright SAIT

Object Orientation Theory Polymorphism –Subclassing takes an abstract class and creates a more specialized version of it, adding features Employee is a special type of person FullTime is a special type of Employee Manager is a special type of FullTime –object can behave as if it were a higher-level object A Manager is a FullTime and an Employee, and a Person Person Employee FullTime Manager Topic CPRG 215 Module 3.1- Fundamental Concepts Copyright SAIT

Object Orientation Theory Inheritance –A subclass inherits the parent’s methods and properties –Java only allows one parent per class But the parent can have a parent, and so on, forming a chain of parent/child relationships called a hierarchy Topic CPRG 215 Module 3.1- Fundamental Concepts Copyright SAIT