Outline. Object Oriented Programming. Course goals. Staff. Course resources. Assignments. Course organization Introduction Java overview Autumn 2003

Similar documents
Agenda CS121/IS223. Reminder. Object Declaration, Creation, Assignment. What is Going On? Variables in Java

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview

CS121/IS223. Object Reference Variables. Dr Olly Gotel

CS 231 Data Structures and Algorithms, Fall 2016

Programming II (CS300)

Assumptions. History

Introduction to Java

Introduction to Programming Using Java (98-388)

JAVA GUI PROGRAMMING REVISION TOUR III

Sri Vidya College of Engineering & Technology

CE221 Programming in C++ Part 1 Introduction

Programming. Syntax and Semantics

Chapter 2: Java OOP I

Goal of lecture. Object-oriented Programming. Context of discussion. Message of lecture

Computer Components. Software{ User Programs. Operating System. Hardware

Lecture 1: Overview of Java

Object-oriented programming. and data-structures CS/ENGRD 2110 SUMMER 2018

Programming Language Concepts: Lecture 2

Course Outline. Introduction to java

JAVA: A Primer. By: Amrita Rajagopal

CS/B.TECH/CSE(New)/SEM-5/CS-504D/ OBJECT ORIENTED PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70 GROUP A. (Multiple Choice Type Question)

Learning objectives. The Java Environment. Java timeline (cont d) Java timeline. Understand the basic features of Java

(800) Toll Free (804) Fax Introduction to Java and Enterprise Java using Eclipse IDE Duration: 5 days

Programming Language Concepts: Lecture 2

Objectives. Problem Solving. Introduction. An overview of object-oriented concepts. Programming and programming languages An introduction to Java

Lecture 2. COMP1406/1006 (the Java course) Fall M. Jason Hinek Carleton University

Java Basics. Object Orientated Programming in Java. Benjamin Kenwright

Java Basic Syntax. Java vs C++ Wojciech Frohmberg / OOP Laboratory. Poznan University of Technology

Outline. Parts 1 to 3 introduce and sketch out the ideas of OOP. Part 5 deals with these ideas in closer detail.

PROGRAMMING FUNDAMENTALS

G52PGP. Lecture oo3 Java (A real object oriented language)

CSC207H: Software Design. Java + OOP. CSC207 Winter 2018

Introduction to Programming (Java) 4/12

Getting started with Java

Programming II (CS300)

Lecture Notes CPSC 224 (Spring 2012) Today... Java basics. S. Bowers 1 of 8

2. The object-oriented paradigm

Computer Science II (20082) Week 1: Review and Inheritance

WA1278 Introduction to Java Using Eclipse

The Java Programming Language

Outline. Java Models for variables Types and type checking, type safety Interpretation vs. compilation. Reasoning about code. CSCI 2600 Spring

Java Programming. Manuel Oriol, March 22nd, 2007

Marcin Luckner Warsaw University of Technology Faculty of Mathematics and Information Science

Goals. Java - An Introduction. Java is Compiled and Interpreted. Architecture Neutral & Portable. Compiled Languages. Introduction to Java

Lecture 6 Introduction to Objects and Classes

Chapter 5: Procedural abstraction. Function procedures. Function procedures. Proper procedures and function procedures

CSC207 Week 3. Larry Zhang

Java Identifiers, Data Types & Variables

2 rd class Department of Programming. OOP with Java Programming

Lecture 7: Classes and Objects CS2301

The Sun s Java Certification and its Possible Role in the Joint Teaching Material

From C++ to Java. Duke CPS

Object-Oriented Programming Concepts

DM550 Introduction to Programming part 2. Jan Baumbach.

COT 3530: Data Structures. Giri Narasimhan. ECS 389; Phone: x3748

Chapter 6 Introduction to Defining Classes

CS 11 java track: lecture 1

Object Oriented Design: Identifying Objects

Object Oriented Programming: In this course we began an introduction to programming from an object-oriented approach.

Fall 2017 CISC124 9/16/2017

2. The object-oriented paradigm!

Index. Course Outline. Grading Policy. Lab Time Distribution. Important Instructions

Outline. Overview. Control statements. Classes and methods. history and advantage how to: program, compile and execute 8 data types 3 types of errors

Creating an object Instance variables

Selected Questions from by Nageshwara Rao

1 Shyam sir JAVA Notes

5/3/2006. Today! HelloWorld in BlueJ. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont.

CS321 Languages and Compiler Design I. Winter 2012 Lecture 2

COE318 Lecture Notes Week 6 (Oct 10, 2011)

Introduction to Java

Chapter. Focus of the Course. Object-Oriented Software Development. program design, implementation, and testing

The Java programming environment. The Java programming environment. Java: A tiny intro. Java features

Announcements. 1. Forms to return today after class:

Selected Java Topics

DAD Lab. 1 Introduc7on to C#

Give one example where you might wish to use a three dimensional array

IQTIDAR ALI Lecturer IBMS Agriculture University Peshawar

Brief Summary of Java

Crash Course in Java. Why Java? Java notes for C++ programmers. Network Programming in Java is very different than in C/C++

Introduction to Programming (Java) 2/12

Java Applets. Last Time. Java Applets. Java Applets. First Java Applet. Java Applets. v We created our first Java application

CS 251 Intermediate Programming Methods and Classes

CS 251 Intermediate Programming Methods and More

BASIC COMPUTATION. public static void main(string [] args) Fundamentals of Computer Science I

Two s Complement Review. Two s Complement Review. Agenda. Agenda 6/21/2011

Compiling Techniques

Virtual Machine. Part I: Stack Arithmetic. Building a Modern Computer From First Principles.

9 Working with the Java Class Library

Contents. I. Classes, Superclasses, and Subclasses. Topic 04 - Inheritance

OOPs Concepts. 1. Data Hiding 2. Encapsulation 3. Abstraction 4. Is-A Relationship 5. Method Signature 6. Polymorphism 7. Constructors 8.

CSCI 136 Data Structures & Advanced Programming. Lecture 3 Fall 2018 Instructors: Bill & Bill

SERIOUS ABOUT SOFTWARE. Qt Core features. Timo Strömmer, May 26,

Course information. Petr Hnětynka 2/2 Zk/Z

Java Programming. Atul Prakash

Spring 2003 Instructor: Dr. Shahadat Hossain. Administrative Matters Course Information Introduction to Programming Techniques

Answer1. Features of Java

Java. Representing Data. Representing data. Primitive data types

About this exam review

Java for Programmers Course (equivalent to SL 275) 36 Contact Hours

Java Intro 3. Java Intro 3. Class Libraries and the Java API. Outline

Transcription:

Outline Object Oriented Programming Autumn 2003 2 Course goals Software design vs hacking Abstractions vs language (syntax) Java used to illustrate concepts NOT a course about Java Prerequisites knowledge of C, C++, or similar some programming experience Staff Lecturer: Timour Katchaounov (Timour.Katchaounov@it.uu.se) Assistants (seminars, labs): Jesper Wilhelmsson (Jesper.Wilhelmsson@it.uu.se) Ruslan Fomkin (Ruslan.Fomkin@it.uu.se) E-mail subject: OOP-HT03: xxx 3 4 Course resources All course information (schedule, slides, etc.): http://www.csd.uu.se/datalogi/cmtrl/oop/ht03/ Course management system: Everyone should register Accessible from university network http://udblserv.it.uu.se:8080/oop_ht03 Assignments Voluntary Java assignment After the lab assumed to know Java Pasture simulation Four assignments - 4 points Extra fifth assignment - 5 points 2 students per group 5 6

Literature Course: Barbara Liskov: Program Development in Java. Java: Bruce Eckel: Thinking in Java www.bruceeckel.com Java Language/API docs: java.sun.com developer.java.sun.com java.sun.com/docs/books/tutorial Outline 7 8 Software design Real systems are big Apache: ~50000 lines Communicator 4: ~3 000 000 lines Requires many people to cooperate Hard to understand, develop, maintain Need for methods to handle complexity => Decomposition and abstraction Decomposition Decompose problems into sub-problems Same level of detail Independent Combined solve the original problem Break up a system into modules 9 10 Abstraction Ignore details => focus on important properties Simplify the problem Many-to-one mapping Examples: sets, numbers, humans Design: abstract -> decompose -> abstract -> Abstraction methods Abstraction by parameterization ignore identity, focus on common properties module reusability Abstraction by specification ignore implementation, focus on function Module independence 11 12

Types of abstractions (1) Procedural abstractions abstract some operation Introduce new operations Data abstractions Sets of similar objects and their operations Operations are related Introduce new data types Types of abstractions (2) Iteration abstractions Ignore item storage & retrieval details Type hierarchies Group similar/related abstractions Allow to ignore differences Subtypes/supertypes 13 14 Types of abstractions (3) Combined use of parameterization and specification Abstraction is language independent Any programming language can be used Object-oriented languages make things easier The data abstraction is central for OO programming and design 15 Outline 16 Java overview Reference implementation by SUN Platform independent Compiled into bytecode (kind of assembler) Programs run on a virtual machine JVM Automatic memory management - garbage collection 17 OO abstractions in Java Specification => interfaces, javadoc, assertions Parameterization => methods, classes Data abstractions => classes & objects Procedural abstractions => methods Iteration abstractions => loops (for, while, do), iterators Type hierarchies => class inheritance 18

Java programs Consist of classes and/or an interfaces Collections of procedures Data abstractions No global variables, no free functions Each class in its own file Interface and implementation in one file (no.h files) Classes Consist of fields and methods public class Square extends Shape { private float xcoordinate; public void rotate(float degree) { 19 20 Java Types Classes - system and user defined Primitive types - system defined: byte, short, int, long, (8,16,32,64 bit), boolean, char (16 bit), float, double for performance Can be wrapped in classes Arrays: Are objects <type>[] <name>; String names[]; Can t grow Objects and variables Data accessed through variables Contain objects (on heap) or values (on stack) Primitive and reference variables Object creation - the new operator Equality: == and equals Object identity Mutability and sharing Array objects 21 22 Class fields Describe state of objects and classes <visibility> <type> <name> = <value>; public float xcoordinate = 74.3; Accessed through objects someobject.fieldname Static fileds - value shared by all class objects static <visibility> <type> <name> = <value>; Accessed through class: someclass.fieldname 23 Methods Method declaration and creation <visibility> <return type> <name>(formal params) { body; Call semantics expr.somemethod(param1, ); Class vs instance methods Constructor methods Initialize objects Used through new operator 24

Packages Group related classes and interfaces Provide for modularity Class/interface visibility Fully qualified names Known syntax for, while, do switch No goto No pointers 25 26 Java applications Console applications GUI applications Standalone vs. applets Java applications: the main method Entry point to run applications Static public main(string[] args) { One per class testing alternative program versions 27 28 Java applications: minimal Java program class hello { public static void main (String[] args) { System.out.println( Hello world! ); System.exit(0); 29