Introduction to Classes, Objects, Methods and Attributes Lecture # 2.

Slides:



Advertisements
Similar presentations
Introduction to classes Sangeetha Parthasarathy 06/11/2001.
Advertisements

Understand and appreciate Object Oriented Programming (OOP) Objects are self-contained modules or subroutines that contain data as well as the functions.
CS0007: Introduction to Computer Programming Introduction to Classes and Objects.
1 OBJECT-ORIENTED CONCEPTS. 2 What is an object?  An object is a software entity that mirrors the real world in some way.  A software object in OOP.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley STARTING OUT WITH Python Python First Edition by Tony Gaddis Chapter 9 Classes.
BITS Pilani Avinash Gautam Department of Computer Science and Information Systems.
Chapter 6: A First Look at classes. Object-Oriented Programming  Object-oriented programming is centered on creating objects rather than procedures.
Classes & Objects Computer Science I Last updated 9/30/10.
1 Fall 2009ACS-1903 Chapter 1 Topics Java History Java Programs Why Program? Computer Systems: Hardware and Software Programming Languages What Is a Program.
Chapter 1 Object-Oriented System Development
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Java: Early Objects Third Edition by Tony Gaddis Chapter.
Object Oriented System Development with VB .NET
What is an object? Your dog, your desk, your television set, your bicycle. Real-world objects share two characteristics: They all have state and behavior;
1 Fall 2007ACS Fall 2007 Text: Starting out with java from control structures through data structures Gaddis & Muganda Instructor: Ron McFadyen.
Object-oriented Programming Concepts
Visual Basic Introduction IDS 306 from Shelly, Cashman & Repede Microsoft Visual Basic 5: Complete Concepts and Techniques.
1 Fall 2007ACS-1903 Chapter 6: Classes Classes and Objects Instance Fields and Methods Constructors Overloading of Methods and Constructors Scope of Instance.
ASP.NET Programming with C# and SQL Server First Edition
C++ fundamentals.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
1.11 Introduction to OOP academy.zariba.com 1. Lecture Content 1.What is OOP and why use it? 2.Classes and objects 3.Static classes 4.Properties, fields.
Object Oriented Programming
TCU CoSc Introduction to Programming (with Java) Getting to Know Java.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 Chapter 1: Introduction to Computers and Java Starting Out with Java From.
Introduction to Object-oriented programming and software development Lecture 1.
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
An Object-Oriented Approach to Programming Logic and Design
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Starting Out With Java 5 (Control Structures to Objects) Chapter 6 By Tony Gaddis Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Java: From Control Structures through Objects Third Edition.
Starting Out with Java: From Control Structures through Objects.
Introduction To System Analysis and Design
JavaScript, Fourth Edition
Chapter 6 Object-Oriented Java Script JavaScript, Third Edition.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Procedural and Object-Oriented Programming 13.1.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 13 Introduction to Classes.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
OBJECT-ORIENTED PROGRAMMING (OOP) WITH C++ Instructor: Dr. Hany H. Ammar Dept. of Electrical and Computer Engineering, WVU.
An Object-Oriented Approach to Programming Logic and Design Chapter 3 Using Methods and Parameters.
Definition of Object - Oriented Language.. Object-oriented programming (OOP) is a programming language model organized around "objects" rather than "actions"
Learners Support Publications Object Oriented Programming.
CSC 131 Fall 2006 Lecture # 6 Object-Oriented Concepts.
Abstraction ADTs, Information Hiding and Encapsulation.
Programming Paradigms Lecturer Hamza Azeem. What is PP ? Revision of Programming concepts learned in CPLB Learning how to perform “Object-Oriented Programming”
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (1/2)
Introduction to Classes and Objects. Real Life When a design engineer needs an electrical motor he doesn’t need to worry about –How a foundry will cast.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 26 - Java Object-Based Programming Outline 26.1Introduction.
Java Fundamentals Usman Ependi UBD
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 12 Object-Oriented Programming Starting Out with Games & Graphics.
© 2010 Pearson Addison-Wesley. All rights reserved. 6-1 Chapter Topics Chapter 6 discusses the following main topics: –Classes and Objects –Instance Fields.
OOP Review CS 124.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Introduction to Classes, Objects, Methods and Attributes Lecture # 5.
Starting Out With Java 5 Control Structures to Objects By Tony Gaddis Copyright © 2005, 2005 Pearson Addison-Wesley. All rights reserved. Chapter 6 Slide.
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.
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (2/2)
CSE 2341 Object Oriented Programming with C++ Note Set #4
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (1/2)
Introduction to Java. Java  An Object-Oriented, platform-neutral, secure language.  Object Oriented – software development method – a program is thought.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 Chapter 1: Introduction to Computers and Java Starting Out with Java From.
Outline Object-Oriented Concepts Modeling Components Structured Method Evaluation Procedure Object-Oriented Methods Structured Methods Review of Object.
Computer Programming II Lecture 5. Introduction to Object Oriented Programming (OOP) - There are two common programming methods : procedural programming.
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
Object Oriented Programming
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
C++.
Classes and Objects housefly object Insect class mosquito object
Chapter 6: A First Look at classes
Presentation transcript:

Introduction to Classes, Objects, Methods and Attributes Lecture # 2

1-2 Object-Oriented Programming Object-oriented programming is centered on creating objects rather than procedures. Objects are a melding of data and procedures that manipulate that data. Data in an object are known as attributes. Procedures in an object are known as methods.

1-3 Object-Oriented Programming Data Hiding Data hiding is important for several reasons. – It protects of attributes from accidental corruption by outside objects. – It hides the details of how an object works, so the programmer can concentrate on using it. – It allows the maintainer of the object to have the ability to modify the internal functioning of the object without “breaking” someone else’s code.

1-4 Object-Oriented Programming Code Reusability Object-Oriented Programming (OOP) has encouraged component reusability. A component is a software object contains data and methods that represents a specific concept or service. Components typically are not stand-alone programs. Components can be used by programs that need the component’s service. Reuse of code promotes the rapid development of larger software projects.

1-5 Classes and Objects Components are objects. The programmer determines the attributes and methods needed, and then creates a class. A class is a collection of programming statements that define the required object A class as a “blueprint” that objects may be created from. An object is the realization (instantiation) of a class in memory.

1-6 Classes and Objects Components are objects. The programmer determines the attributes and methods needed, and then creates a class. A class is a collection of programming statements that define the required object A class as a “blueprint” that objects may be created from. An object is the realization (instantiation) of a class in memory.

1-7 Classes and Objects Classes can be used to instantiate as many objects as are needed. Each object that is created from a class is called an instance of the class. A program is simply a collection of objects that interact with each other to accomplish a goal.

1-8 Classes and Objects Insect class The Insect class defines the attributes and methods that will exist in all objects that are an instances of the Insect class. housefly object The housefly object is an instance of the Insect class. mosquito object The mosquito object is an instance of the Insect class.