Object Orientated Concepts. Overview  The world is objects  Defining an object  Not a function, it’s a method  Lets inherit want we can  Objects.

Slides:



Advertisements
Similar presentations
Chapter 1 Inheritance University Of Ha’il.
Advertisements

Object Oriented Programming in Java. Object Oriented Programming Concepts in Java Object oriented Programming is a paradigm or organizing principle for.
OOP - Object Oriented Programming Object Oriented Programming is an approach to programming that was developed to make large programs easier to manage.
C HAPTER 7 Better Living in Objectville. O VERVIEW Understanding Inheritance Designing an Inheritance Tree Avoiding Duplicate Code Overriding Methods.
1 Inheritance Reserved word protected Reserved word super Overriding methods Class Hierarchies Reading for this lecture: L&L 8.1 – 8.5.
Objects and Classes First Programming Concepts. 14/10/2004Lecture 1a: Introduction 2 Fundamental Concepts object class method parameter data type.
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Aalborg Media Lab 23-Jun-15 Inheritance Lecture 10 Chapter 8.
OOP in Java Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Inheritance and Polymorphism CS351 – Programming Paradigms.
INTRODUCTION TO JAVA PROGRAMMING Chapter 1. What is Computer Programming?
LECTURE 07 Programming using C# Inheritance
CSE 331 Software Design & Implementation Hal Perkins Autumn 2012 Java Classes, Interfaces, and Types 1.
Fall 2006AE6382 Design Computing1 OOP: Creating a Class More OOP concepts An example that creates a ASSET class and shows how it might be used Extend the.
Object Oriented Programming: Java Edition By: Samuel Robinson.
DEPENDENCY INJECTION & INVERSION OF CONTROL. WHAT’S GOING TO BE COVERED Quick intro to C# for Java developers Dependency Injection Inversion of Control.
Method Overriding Remember inheritance: when a child class inherits methods, variables, etc from a parent class. Example: public class Dictionary extends.
Java Classes Methods Objects. Classes Classes We have been using classes ever since we started programming in Java Whenever we use the keyword class.
Computer Science II 810:062 Section 01. How is CS I different from CS II? When you teach Java there are a series of decisions that have to be made…
Chapter 7 Objects and Classes 1 Fall 2012 CS2302: Programming Principles.
Encapsulation, Inheritance & Polymorphism. OOP Properties Encapsulation ­The process of creating programs so that information within a class is not accessible.
1 Advanced Issues on Classes Part 3 Reference variables (Tapestry pp.581, Horton 176 – 178) Const-reference variables (Horton 176 – 178) object sharing:
Chapter 12 Object Oriented Design.  Complements top-down design  Data-centered view of design  Reliable  Cost-effective.
OOP in Java : © W. Milner 2005 : Slide 1 Java and OOP Part 2 – Classes and objects.
Topic 1 Object Oriented Programming. 1-2 Objectives To review the concepts and terminology of object-oriented programming To discuss some features of.
1 Programming Paradigms Object Orientated Programming Paradigm (OOP)
1 Chapter 5 - Object-Oriented Programming 1 What is inheritance? Object-oriented systems allow classes to be defined in terms of other classes. Classes.
JAVA COURSE 1 Computer Engineering Association. Compile your first program Public class Hello{ public class Hello(){ System.out.println(“Hello”); } puclic.
Classes Java and other Object-Orientated Programs or OOP are based on the creation and interaction of classes. Every program in Java has at least one class.
Abstract Classes and Interfaces 5-Dec-15. Abstract methods You can declare an object without defining it: Person p; Similarly, you can declare a method.
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 5 Creating Classes.
Classes. Student class We are tasked with creating a class for objects that store data about students. We first want to consider what is needed for the.
MIT AITI 2004 – Lecture 13 Abstract Classes and Interfaces.
CS305j Introduction to Computing Classes 1 Topic 23 Classes – Part I "A 'class' is where we teach an 'object' to behave." -Rich Pattis Based on slides.
Classes Modeling the Object. Objects model the world Classes are programmer defined types that model the parts of a system Class serve as blueprints for.
Method Overriding Remember inheritance: when a child class inherits methods, variables, etc from a parent class. Example: public class Dictionary extends.
Today… “Hello World” ritual. Brief History of Java & How Java Works. Introduction to Java class structure. But first, next slide shows Java is No. 1 programming.
Java: Variables and Methods By Joshua Li Created for the allAboutJavaClasses wikispace.
CSCI 171 Presentation 15 Introduction to Object–Oriented Programming (OOP) in C++
POLYMORPHISM Chapter 6. Chapter Polymorphism  Polymorphism concept  Abstract classes and methods  Method overriding  Concrete sub classes and.
Basic Syntax อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา Chapter 2.
OOP Basics Classes & Methods (c) IDMS/SQL News
Object means a real word entity such as pen, chair, table etc. Object-Oriented Programming is a methodology or paradigm to design a program using classes.
Comp1004: Inheritance II Polymorphism. Coming up Inheritance Reminder Overriding methods – Overriding and substitution Dynamic Binding Polymorphism –
Learning Plan 6 Java Programming Intro to Object Oriented Programming.
OOP: Creating a Class Topics More OOP concepts
Programming in Java: lecture 7
OOP - Object Oriented Programming
Concepts of Object Oriented Programming
Lecture 12 Inheritance.
Objects as a programming concept
Week 8 Lecture -3 Inheritance and Polymorphism
Chapter 10 Thinking in Objects
March 29th Odds & Ends CS 239.
Inheritance Basics Programming with Inheritance
More inheritance, Abstract Classes and Interfaces
Object Oriented Programming (OOP) LAB # 5
Inherited Classes in Java
Object oriented vs procedural programming
Advanced Programming Behnam Hatami Fall 2017.
Computer Programming with JAVA
Objects First with Java A Practical Introduction using BlueJ
Session 2: Introduction to Object Oriented Programming
Objects First with Java A Practical Introduction using BlueJ
Java Coding 4 (part2) David Davenport Computer Eng. Dept.,
An Example of Inheritance
CSCI 130 Classes and Objects.
Methods/Functions.
Topics OOP Review Inheritance Review Abstract Classes
CSG2H3 Object Oriented Programming
Presentation transcript:

Object Orientated Concepts

Overview  The world is objects  Defining an object  Not a function, it’s a method  Lets inherit want we can  Objects don’t have ‘mains’  Look at some Java Code

The world is objects (pg 34)  Everything is an object.  They have values  Things can be done to them  In small groups, starting with the object of a car, what are some methods about the car?

How does Java know what an object looks like?  Class definition public class ExampleApp{ public static void main (Strings[] args){ //some main code } public void ExampleMeth{ //Some other code }

Not a function, it’s a method  Methods can be public or private  In C, all functions are public  They work on the object and sometimes accept inputs

Lets inherit want we can (pg. 31)  An object ‘cat’ is a subset of ‘animal’ hence cat inherits the traits of animal  A new object ‘mushroom’ might inherit some of the ‘animal’ superclass but would have some very different methods and instance variables

Objects don’t have ‘mains’(pg.38)  Objects don’t have a ‘main’  If there is a ‘main’ it should test the current object only

Lets look at some Java code in detail (pg. 39)  Take a few minutes to look over the code on page 39.

Things to remember  Java and C share some syntax  This can be tricky  When doing OOP, think of code as interacting objects rather than a program that does different tasks  OOP can lead to easier revisions later, but a lot of the worlds code is not OOP