Objects and Classes First Programming Concepts. 14/10/2004Lecture 1a: Introduction 2 Fundamental Concepts object class method parameter data type.

Slides:



Advertisements
Similar presentations
Looking inside classes Fields, Constructors & Methods Week 3.
Advertisements

Object Interaction and Source Code Week 2. OBJECT ORIENTATION BASICS REVIEW.
Introduction to Object-Oriented Programming CS 21a: Introduction to Computing I First Semester,
1 Programming for Engineers in Python Autumn Lecture 5: Object Oriented Programming.
Objects First with Java A Practical Introduction using BlueJ
Introduction to Java Programming
1 Programming Languages b Each type of CPU has its own specific machine language b But, writing programs in machine languages is cumbersome (too detailed)
Understanding class definitions Looking inside classes 3.0.
Aalborg Media Lab 21-Jun-15 Software Design Lecture 1 “ Introduction to Java and OOP”
Copyright by Scott GrissomCh 1 Objects and Classes Slide 1 Classes and Objects A Class refers to something in general describes a category of items a cookie.
Objects Interaction and Source Code Week 2. OBJECT ORIENTATION BASICS REVIEW.
Objects & Object-Oriented Programming (OOP) CSC 1401: Introduction to Programming with Java Week 15 – Lecture 1 Wanda M. Kunkle.
Understanding class definitions – Part II –. Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling Main.
CO320 Introduction to Object- Oriented Programming Michael Kölling 3.0.
Understanding class definitions Looking inside classes.
5.0 Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling.
1 CSC 221: Computer Programming I Fall 2004 Objects and classes: a first pass  software objects, classes, object-oriented design  BlueJ IDE, compilation.
Chapter 10 Introduction to Components. Process Phases Discussed in This Chapter Requirements Analysis Design Implementation ArchitectureFramework Detailed.
Introduction to Object Oriented Programming. Object Oriented Programming Technique used to develop programs revolving around the real world entities In.
5.0 Objects First with Java A Practical Introduction using BlueJ Introduction to Computer Science I Instructor: Allyson Anderson.
Introduction to Object-Oriented Programming
1. 2 Object-Oriented Concept Class & Object Object-Oriented Characteristics How does it work? Relationships Between Classes Development Tools Advantage.
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and Server Side Programming Very rich GUI libraries Portability (machine independence) A.
Introduction to Java. 2 Textbook David J. Barnes & Michael Kölling Objects First with Java A Practical Introduction using BlueJ Fourth edition, Pearson.
Your First Java Application Chapter 2. 2 Program Concepts Modern object-oriented programs help us build models to manage the complexity found in a problem.
OBJECTS AND CLASSES CITS1001. Concepts for this lecture class; object; instance method; parameter; signature data type multiple instances; state method.
1 COS 260 DAY 2 Tony Gauvin. 2 Agenda Questions? Class roll call Blackboard Web Resources Objects and classes 1 st Mini quiz on chap1 terms and concepts.
1 COS 260 DAY 1 Tony Gauvin. 2 Agenda Class roll call Instructor Introduction Instructor’s Educational Philosophy Contract on Classroom Behavior Syllabus.
Chapter 1 Object Orientation: Objects and Classes.
SWE 316: Software Design and Architecture Objectives Lecture # 18 Introduction to Components SWE 316: Software Design and Architecture To learn:  benefits.
JAVA Classes Review. Definitions Class – a description of the attributes and behavior of a set of computational objects Constructor – a method that is.
Understanding class definitions
5.0 Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling.
Component 4: Introduction to Information and Computer Science Unit 5: Overview of Programming Languages, Including Basic Programming Concepts Lecture 5.
Chapter 5 Classes and Methods II Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N. Kamin, D. Mickunas, E.
Looking inside classes Conditional Statements Week 4.
Object Oriented Programming and Data Abstraction Rowan University Earl Huff.
1.1: Objects and Classes msklug.weebly.com. Agenda: Attendance Let’s get started What is Java? Work Time.
Lecture 3: More on Classes Textbook: Chapter 2 Recap: –Classes vs. Objects –Q: What comes first a class or an object? –Q: Do we need a class to create.
Reflections CSC207 – Software Design. Background Turing's great insight: programs are just another kind of data. Source code is text that is interpreted.
Testing in OO Environment The reasons for testing is not any different for any of the design and implementation methodologies, including OO methodology.
Kyung Hee University Class Diagramming Notation OOSD 담당조교 석사과정 이정환.
CSE 501N Fall ‘09 03: Class Members 03 September 2009 Nick Leidenfrost.
David Streader Computer Science Victoria University of Wellington Copyright: David Streader, Victoria University of Wellington Java Programing Basics COMP.
6.0 Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling.
Chapter 1 Object Orientation: Objects and Classes.
Java Interfaces CS 21a: Introduction to Computing I Department of Information Systems and Computer Science Ateneo de Manila University (see Chapter 9 of.
Introduction to Java Chapter 1 - Introduction to Java1 Chapter 1 Introduction to Java.
Objects and Classes CITS1001 week 1.
Objects First with Java A Practical Introduction using BlueJ
Objects as a programming concept
Object Oriented Programming
Objects First with Java A Practical Introduction using BlueJ
What is an object? An object represents an individual, identifiable item, unit, or entity, either real or abstract, with a well-defined role in the.
Java Programming with BlueJ
Understanding class definitions
Your First Java Application
An Introduction to Java – Part II
COS 260 DAY 2 Tony Gauvin.
The Object-Oriented Thought Process Chapter 04
Class Everything if Java is in a class. The class has a constructor that creates the object. public class ClassName private Field data (instance variables)
Objects First with Java A Practical Introduction using BlueJ
Understanding class definitions
Object Oriented Programming in java
Objects First with Java A Practical Introduction using BlueJ
Introduction to Object-Oriented Programming
Further abstraction techniques
CS 1054: Lecture 2, Chapter 1 Objects and Classes.
Day 11 The Last Week!.
Presentation transcript:

Objects and Classes First Programming Concepts

14/10/2004Lecture 1a: Introduction 2 Fundamental Concepts object class method parameter data type

14/10/2004Lecture 1a: Introduction 3 Objects and Classes Objects represent ‘things’ from the real world, or from some problem domain (example: “the red car down there in the car park”) Classes represent all objects of a kind (example: “car”) Objects represent individual instantiations of the class. Object are instantiated.

14/10/2004Lecture 1a: Introduction 4 Objects and Classes in BlueJ

14/10/2004Lecture 1a: Introduction 5 Things we can do with Objects

14/10/2004Lecture 1a: Introduction 6 Things we can do with Objects

14/10/2004Lecture 1a: Introduction 7 Methods and Parameters Objects/classes have operations which can be invoked. They are called methods void moveHorizontal(int distance) is called the signature of the methods The collection of methods of a class is referred to as the interface of that class methods may have parameters to pass additional information needed to execute Methods are called or invoked

14/10/2004Lecture 1a: Introduction 8 Data Types Parameters have types. A type defines what kinds of values a parameter can take. Defining a class defines a type In Java, everything has a type. Java is strongly typed language Examples of types: int, String, Circle, …

14/10/2004Lecture 1a: Introduction 9 Other Observations many instances can be created from a single class an object has attributes: values stored in fields. the class defines what fields an object has, but each object stores its own set of values. These set of values is called the state of the object.

14/10/2004Lecture 1a: Introduction 10 State

14/10/2004Lecture 1a: Introduction 11 Two Circle Objects

14/10/2004Lecture 1a: Introduction 12 Object Interaction

14/10/2004Lecture 1a: Introduction 13 Source Code Each class has source code (Java code) associated with it that defines its details (fields and methods). In other words, it determines the structure and the behavior of each of its instance. This source code is compiled and interpreted by Java.

14/10/2004Lecture 1a: Introduction 14 Return Values Methods may return a result via a return value. Example: String getName() This method returns a String. Example: void changeName() Void indicates that this method does not return anything

14/10/2004Lecture 1a: Introduction 15 Developing Java Programs To learn to develop Java programs, one needs to learn how to write class definitions, including fields and methods, and how to put these classes together as well During the rest of this unit we will deal with these issues in more detail

14/10/2004Lecture 1a: Introduction 16 Terms Object Instance State Compiler Virtual Machine Method Calling Class Method Return Value Signature Parameter Type Source Code