Object Oriented Programming Teguh Sutanto Si | STIKOM Surabaya

Slides:



Advertisements
Similar presentations
STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
Advertisements

INHERITANCE BASICS Reusability is achieved by INHERITANCE
C++ Classes & Data Abstraction
Chapter 4&5 Defining Classes Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Object Oriented Programming in Java. Object Oriented Programming Concepts in Java Object oriented Programming is a paradigm or organizing principle for.
Computer Science and Engineering College of Engineering The Ohio State University Classes and Objects: Members, Visibility The credit for these slides.
Lecture 2: Object Oriented Programming I
Object Oriented Programming. Problem Description “ …customers are allowed to have different types of bank accounts, deposit money, withdraw money and.
1 Chapter 7 Inheritance, Polymorphism, and Scope.
Object-Oriented Programming Concept. Concepts of Object Orientation Objects and classes. method Message passing Inheritance.
Objects & Object-Oriented Programming (OOP) CSC 1401: Introduction to Programming with Java Week 15 – Lecture 1 Wanda M. Kunkle.
Applying OO Concepts Using Java. In this class, we will cover: Overriding a method Overloading a method Constructors Mutator and accessor methods The.
C++ fundamentals.
1 Chapter 8 Objects and Classes. 2 Motivations After learning the preceding chapters, you are capable of solving many programming problems using selections,
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
Principles of Computer Programming (using Java) Review Haidong Xue Summer 2011, at GSU.
3.1 Documentation & Java Language Elements Purpose of documentation Assist the programmer with developing the program Assist other programers who.
Introduction to Java Appendix A. Appendix A: Introduction to Java2 Chapter Objectives To understand the essentials of object-oriented programming in Java.
CSM-Java Programming-I Spring,2005 Introduction to Objects and Classes Lesson - 1.
Introduction to Object Oriented Programming. Object Oriented Programming Technique used to develop programs revolving around the real world entities In.
Java Language and SW Dev’t
Object Oriented Design: Identifying Objects
CSC 212 Object-Oriented Programming and Java Part 1.
By Nicholas Policelli An Introduction to Java. Basic Program Structure public class ClassName { public static void main(String[] args) { program statements.
Lecture 2 Object Oriented Programming Basics of Java Language MBY.
Chapter 8. About the Midterm Exam.. Exam on March 12 Monday (Tentatively) Review on March 7 Wednesday Cover from Chapter 6 Grades will be out before spring.
JAVA Tokens. Introduction A token is an individual element in a program. More than one token can appear in a single line separated by white spaces.
Java means Coffee Java Coffee Beans The name “JAVA” was taken from a cup of coffee.
Chapter 7 Objects and Classes 1 Fall 2012 CS2302: Programming Principles.
Chapter 4: A Paradigm Program structure Connecting to the Java world Types Access modifiers Lifetime modifiers.
An Introduction to Java – Part 1 Dylan Boltz. What is Java?  An object-oriented programming language  Developed and released by Sun in 1995  Designed.
Java The Java programming language was created by Sun Microsystems, Inc. It was introduced in 1995 and it's popularity has grown quickly since A programming.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 6: Object-Oriented Programming.
C++ Programming Basic Learning Prepared By The Smartpath Information systems
Definition of Object - Oriented Language.. Object-oriented programming (OOP) is a programming language model organized around "objects" rather than "actions"
Chapter 8 Objects and Classes Object Oriented programming Instructor: Dr. Essam H. Houssein.
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
JAVA COURSE 1 Computer Engineering Association. Compile your first program Public class Hello{ public class Hello(){ System.out.println(“Hello”); } puclic.
Chapter 4&5 Defining Classes Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Basic Object-Oriented Concepts – towards implementation CS3340.
CS100A, Fall 1998 Key Concepts 1 These notes contain short definitions of the basic entities that make up a Java program, along with a description of the.
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 9 Java Fundamentals Objects/ClassesMethods Mon.
1 COS240 O-O Languages AUBG, COS dept Lecture 12 Title: Java Classes and Objects Reference: COS240 Syllabus.
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
Classes, Interfaces and Packages
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
Computer Programming 2 Lecture 8: Object Oriented Programming Creating Classes & Objects Prepared & Presented by: Mahmoud Rafeek Alfarra MINISTRY OF EDUCATION.
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 Session # 03.  Abstraction: Process of forming of general and relevant information from a complex scenarios.  Encapsulation:
Object Oriented Programming. OOP  The fundamental idea behind object-oriented programming is:  The real world consists of objects. Computer programs.
In this class, we will cover: Overriding a method Overloading a method Constructors Mutator and accessor methods The import statement and using prewritten.
Object-Oriented Programming Fundamentals. Comp 241, Fall Example Colored points on the screen What data goes into making one? Coordinates Color.
Author: DoanNX Time: 45’.  OOP concepts  OOP in Java.
1 COS240 O-O Languages AUBG, COS dept Lecture 12 Title: Java Classes and Objects Reference: COS240 Syllabus.
CS100Lecture 61 Announcements Homework P1 due on Thursday Homework P2 handed out.
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.
 The Object Oriented concepts was evolved for solving complex problems. Object- oriented software development started in the 1980s. Object-oriented design.
Functions + Overloading + Scope
Objects as a programming concept
JAVA MULTIPLE CHOICE QUESTION.
Understand the Fundamentals of Classes
Objects as a programming concept
Trainings 11/4 Intro to Java.
Chapter 3 Introduction to Classes, Objects Methods and Strings
Chapter 10 Thinking in Objects
An Introduction to Java – Part I, language basics
The Building Blocks Classes: Java class library, over 1,800 classes:
Programs and Classes A program is made up from classes
Java Programming Language
Presentation transcript:

Object Oriented Programming Teguh Sutanto Si | STIKOM Surabaya

GOAL 1.Students can understand the Object Oriented Programming concepts 2.Students can make a program in accordance with the rules of Object Oriented Programming

Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs

Object-oriented programming (OOP) is a programming language model organized around "objects" rather than "actions" and data rather than logic. Historically, a program has been viewed as a logical procedure that takes input data, processes it, and produces output data

Why OOP? 1.Object-oriented systems can be easily upgraded from small to large scale. 2.It is easy to partition the work in a project based on objects. 3. Object-oriented programming offers a new and powerful model for writing computer software. 4.It reduces software maintenance and developing costs. 5.Changes in user requirements or later developments have always been a major problem. 6.Object-orientation or object oriented programming (OOP) should help one in developing high quality software easily.

Concept of Class and Object “Class” refers to a blueprint. It defines the variables and methods the objects support “Object” is an instance of a class. Each object has a class which defines its data and behavior

Concept of Class and Object

Classes reflect concepts, objects reflect instances that embody those concepts Daria Jane Brittany Jodie girl class object

Class:A class can have three kinds of members: Fields/attribute/data: data variables which determine the status of the class or an object methods: xecutable code of the class built from statements. It allows us to manipulate/change the status of an object or access the value of the data member nested classes and nested interfaces

Attribute/Field/Data Method

Field Declaration a type name followed by the field name, and optionally an initialization clause primitive data type vs. Object reference – boolean, char, byte, short, int, long, float, double field declarations can be preceded by different modifiers – access control modifiers – static – final

Acces Control Modifier 1. private: private members are accessible only in the class itself 2. package: package members are accessible in classes in the same package and the class itself 3. protected: protected members are accessible in classes in the same package, in subclasses of the class, and in the class itself 4. public: public members are accessible anywhere the class is accessible

com app Person - name: String - address: String # age: int +getName(): String Employee HRD X MainMenu X

public class Pencil { public String color = “red”; public int length; public float diameter; private float price; public static long nextID = 0; public void setPrice (float newPrice) { price = newPrice; } public class CreatePencil { public static void main (String args[]){ Pencil p1 = new Pencil(); p1.price = 0.5f; } Pencil.java CreatePencil.java %> javac Pencil.java %> javac CreatePencil.java CreatePencil.java:4: price has private access in Pencil p1.price = 0.5f; ^