G51OOP. Object Oriented Programming Comp Sci University of Nottingham Unit 1 : Introduction

Similar documents
Object Oriented Concepts and Programming (CSC244) By Dr. Tabbasum Naz

Chapter 1 Introduction to Computers, Programs, and Java

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

Lecture 1: Overview of Java

Lecture 1: Introduction to Java

Introduction to Java. Lecture 1 COP 3252 Summer May 16, 2017

CHAPTER 1. Introduction to JAVA Programming

Introduction to Java Programming

Chapter 1 Introduction to Computers, Programs, and Java. What is a Computer? A Bit of History

Introduction to Programming

From High Level to Machine Code. Compilation Overview. Computer Programs

Lecture 09. Ada to Software Engineering. Mr. Mubashir Ali Lecturer (Dept. of Computer Science)

History Introduction to Java Characteristics of Java Data types

Lesson 01 Introduction

Chapter 1 Introduction to Computers, Programs, and Java

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.

Java Language. Programs. Computer programs, known as software, are instructions to the computer. You tell a computer what to do through programs.

Outline. Introduction to Java. What Is Java? History. Java 2 Platform. Java 2 Platform Standard Edition. Introduction Java 2 Platform

Introduction. A. Bellaachia Page: 1

CSE 421 Course Overview and Introduction to Java

Module 1: Introduction to Computers, Programs, and Java

Chapter 1: Introduction to Computers, Programs, and Java

1/14/2014. Introduction to CSE 1325 Object Oriented Programming (Using Java) Introduction (Cont.) Introduction

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

Computational Applications in Nuclear Astrophysics using Java Java course Lecture 1

Low-Level Languages. Computer Programs and Programming Languages

An Introduction to Software Engineering. David Greenstein Monta Vista High School

Course Announcements cs2220: Engineering Software

C++ Spring Break Packet 11 The Java Programming Language

CT 229. CT229 Lecture Notes. Labs. Tutorials. Lecture Notes. Programming II CT229. Objectives for CT229. IT Department NUI Galway

The Computer System. Hardware = Physical Computer. Software = Computer Programs. People = End Users & Programmers. people

CS 113: Introduction to

Software Project. Lecturers: Ran Caneti, Gideon Dror Teaching assistants: Nathan Manor, Ben Riva

Chapter 1 Introduction to Computers, Programs, and Java

Introduction to Java. Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.

TTh 9.25 AM AM Strain 322

This lecture will take you through simple and practical approach while learning Java Programming language.

Chapter 1. Introduction to Computers and Java Objects. Background information. » important regardless of programming language. Introduction to Java

Getting Started. Chapter 1. Java Programming FROM THE BEGINNING. Chapter 1: Getting Started

Programming. Syntax and Semantics

CSC116: Introduction to Computing - Java

Java is a high-level programming language originally developed by Sun Microsystems and released in Java runs on a variety of

CompSci 125 Lecture 02

CS 11 java track: lecture 1

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

CSC116: Introduction to Computing - Java

Computer Principles and Components 1

Programming Language Basics

Chapter 1 Introduction to Computers, Programs, and Java

Introduction to Java

Objectives. Chapter 1 Introduction to Computers, Programs, and Java. What is a Computer?

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

Introduction to Operating Systems. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Chapter 1: Introduction to Computers and Java

8/23/2014. Chapter Topics. Introduction. Java History. Why Program? Java Applications and Applets. Chapter 1: Introduction to Computers and Java

Lecture 1 - Introduction (Class Notes)

COSC 2P95. Introduction. Week 1. Brock University. Brock University (Week 1) Introduction 1 / 18

Advanced Object-Oriented Programming Introduction to OOP and Java

Java Programming. Zheng-Liang Lu. Java 308 Spring Department of Computer Science & Information Engineering National Taiwan University

CSC116: Introduction to Computing - Java

COMP1917: Computing 1 1. Introduction

Kickstart Intro to Java Part I

Java language. Part 1. Java fundamentals. Yevhen Berkunskyi, NUoS

Chapter 1 Introduction to Computers, Programs, and Java

CS11 Java. Fall Lecture 1

Announcements. Java Review. More Announcements. Today. Assembly Language. Machine Language

Getting Started with Java. Atul Prakash

CS240: Programming in C

Introduction to Java. Nihar Ranjan Roy.

Programming Languages FILS Andrei Vasilateanu

Chapter 1 Introduction to Computers, Programs, and Java

Course and Unix Intro

Eng. Mohammed S. Abdualal

CISC 124: Introduction To Computing Science II

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

COMP1917: Computing 1 1. Introduction

SKILL AREA 304: Review Programming Language Concept. Computer Programming (YPG)

Introduction to Computers and Programming Languages. CS 180 Sunil Prabhakar Department of Computer Science Purdue University

Atelier Java - J1. Marwan Burelle. EPITA Première Année Cycle Ingénieur.

INTRODUCTION TO OPERATING SYSTEMS. Jo, Heeseung

History of Java. Java was originally developed by Sun Microsystems star:ng in This language was ini:ally called Oak Renamed Java in 1995

Class List. Java Must Have. Class Goals. Class Goals. Schedule

Programming Language Concepts 1982, 1987, Outline. Period

1. Introduction. Course Web Site. COMP1917: Computing 1. Textbook. Occupational Health and Safety (OHS)

AP Computer Science A: Java Programming

LECTURE/ STUDY NOTES ON C

Chapter 1 Introduction to Computers, Programs, and Java

Introduction to Operating Systems

Introduction to Java Programming CPIT 202. WEWwwbvxnvbxmnhsgfkdjfcn

Lecture 4: Introduction to Java and your Development Environment

Operating System: Chap2 OS Structure. National Tsing-Hua University 2016, Fall Semester

Seminar report Java Submitted in partial fulfillment of the requirement for the award of degree Of CSE

Unit. Programming Fundamentals. School of Science and Technology INTRODUCTION

COSC 2P90 Programming Languages & Object-Orientation

COMP-202 Unit 0: Course Details

C++ Programming for Programmers using Microsoft Visual C Professional

! Learn how to think like a computer scientist. ! Learn problem solving. ! Read and write code. ! Understand object oriented programming

GETTING STARTED. The longest journey begins with a single step. In this chapter, you will learn about: Compiling and Running a Java Program Page 2

Inf1-OOP. Textbooks. Who and What. Organisational issues. Why Java? Course Overview. Hello, World! in Java

McGill University COMP-202A Introduction to Computing I Summer 2006 webct.mcgill.ca

Transcription:

G51OOP Object Oriented Programming Comp Sci University of Nottingham Unit 1 : Introduction

Overview Background Teaching Staff Course Details Assessment OOP Summary Resources Programming Programming Languages High Level Languages Interpreters / Compilers Introduction to Java Java History Java Properties Types of Programs JDK tools The HelloWorld program Using CourseMaster

Teaching Staff Lectures : Colin Higgins, CourseMaster Administrator : Essam Eliwa? Lab Assistants - labs, problems classes Web site - http://www.cs.nott.ac.uk/~cah/g51oop/

Course Details (1 st Semester) 20 lectures. Monday 15:00 : LT2 Tuesday 13:00 : LT2 Coursework exercises. Lab sessions. Tuesdays 14:00 to 16:00. Prerequisites : G51PRG (and a little intelligence J ). Objectives : To learn problem solve, to think in an object-oriented manner and to express solutions as sound implementations in Java.

Assessment Some coursework via the CourseMarker system (used to be called CourseMaster and Ceilidh before that).

Assessment Some courseworks that do not count towards assessment. 3 to 4 courseworks that do. Details to be announced later.

Resources Sun file servers (JDK is installed in Solaris) PCs (JDK is installed in all lab PCs) Favourite editor (notepad?) CourseMaster installed in all lab PCs Later Eclipse Web Site root is at http://www.cs.nott.ac.uk/~cah/g51oop/

Reading Recommended? (but don t buy unless needed): Java Gently by Judy Bishop (Addison-Wes). Java. How to Program by Deitel & Deitel (Prentice Hall). Developing Java Software by Winder & Roberts (Wiley). Java Software Solutions by Lewis and Loftus (Pearson/Addison Wesley). Thinking in Java (Bruce Eckel) (available on the web) Other Sources of Information: USE A WEB SEARCH Sun Java Tutorial : http://java.sun.com/docs/books/tutorial/getstarted/index.html WWW general : search in www.google.com! Intense Java Course : http://www.cs.nott.ac.uk/~azt/java.htm

Programming "A program is a sequence of instructions. A recipe, a musical score, and a knitting pattern are all programs." P Grogono, Programming in Pascal. - The way to deal with an impossible task is to chop it down into a number of merely very difficult tasks, and break each one of them into a group of horribly hard tasks, and each one of them into tricky jobs, and each one of them... (Terry Pratchet, Truckers)

Programming Languages There are four basic programming language levels: machine language assembly language high-level language fourth-generation language Each CPU has its own specific machine language The other levels were created to make programming easier

Programming Languages A program must be translated into machine language before it can be executed on a particular type of CPU This can be accomplished in several ways A compiler is a software tool which translates source code into a specific target language Often, that target language is the machine language for a particular CPU type The Java approach is somewhat different

High Level Languages Old-fashioned languages include: BASIC - often used by beginners on home computers. FORTRAN - old but still popular with some scientists and engineers, new versions are introduced every few years. Algol - an elegant little-used internationally designed language, whose features are being incorporated into other languages. COBOL - a widely used and well standardised language used in commerce. APL - an interactive scientific language with a very mathematical notation. PL/I - a failed attempt by IBM at achieving an all-purpose language, now almost dead.

High Level Languages Other Languages : Pascal - good for beginners, often taught as a first language. Modula2 - a development of Pascal to make it more realistic for large programs, and to enable modern program design techniques to be used. C - a practical language, see below. C++ - an object-oriented development of C. ADA - a USA Department of Defense standard, now adopted by the UK Ministry of Defense also, aimed at safe programming for real-time embedded systems. Java A robust, secure, portable, network enabled variation on C/C+ +.

High Level Languages Compare the COBOL: rate_per_hour multiplied by hours_worked gives gross_pay with C/C++: pay = rate * hours Some language aims: understanding, documentation > commercial (eg COBOL). handling vectors or complex numbers > scientific/engineering (FORTRAN). simplicity > beginners (Basic, Pascal). safety > real time systems (ADA, Modula-2). complexity > object-oriented (C++, Eiffel, Java).

Interpreters vs Compilers Interpretation : BASIC & APL are interpreted. Each line is decoded and interpreted by the computer as it is executed. Instructions in loops may have to be interpreted many times. This is inefficient and causes the computer to run slowly. Compilation : Most other languages are compiled. Whole program first analysed by a compiler (another program). Converted into a machine executable form. Runs much faster (an order of magnitude or more). Can apply many types of optimisation during or after compilation. In two parts compilation into an object module, then loading/linking into the executable.

Java: What is it? Sun s Description. Java is a : Simple Object Oriented Distributed Interpreted Robust Secure Architecture Neutral Portable High Performance Multithreaded and Dynamic programming language. It contains an extensive library of classes for graphics programming, input/output, string handling, maths functions, basic data structures, etc.

Java History C language was evolved as a portable operating system language Dennis Ritchie (at Bell labs) developed it from B (which came from BCPL). Originally ran on a DEC PDP-11 computer in 1972. C++ is an object-oriented extension to C developed by Bjarne Stroustroup early 80 s. Sun had an internal corporate research project, Green, in 1991, to develop intelligent consumer devices. Project lead to the language Oak (James Gosling) based on C/C+ +. Oak about to be cancelled when WWW came along. Sun saw renamed Oak to Java and saw potential for use on the web Java formally announced in May 95. Since then, Java generated huge interest.

Java s Early Versions Java was officially announced in May 1995 Java 1.2.2 First Idea Java 1.02 Java 1.1 Java 1.2 Java 1.3 91 92 93 94 95 96 97 98 99 00 ETC! Green Project OAK

Simple Removes areas of C/C++ that cause most errors Memory management Pointers Templates Operator overloading Has a small set of Language Constructs. Borrows the C and C++ syntax. Is free from pointers. Uses Garbage Collection. Does not use header files and pre-processors.

Object Oriented Not hybrid like C++. Supports the basic notions of OO : Abstraction, Modularity, Encapsulation, Hierarchy, Typing, Concurrency, Persistance.

Distributed Works on a variety of platforms. Provides support for : Networking, Internet, Remote Objects.

Interpreted sort of The Java compiler translates Java source code into a special representation called bytecode Java bytecode is not the machine language for any traditional CPU Another software tool, called an interpreter, translates bytecode into machine language and executes it Therefore the Java compiler is not tied to any particular machine Java is considered to be architecture-neutral Java Source File Java Compiler Java Bytecode Java File Bytecode Java File Bytecode File JVM

Robust Exception and Error handling. Multi-Tasking. Memory protection and management. Allows Modular development. Extensive compile-time checking.

Secure The features of bytecode and its interpretation, prevent unintentional or intentional sabotage of compiled programs. Security has been considered in many levels.

Architecture Neutral Bytecode can run on any JVM on any platform. Write Once run Anywhere. JDK implementation on many platforms. Java Bytecode Mac VM WinXP VM Solaris VM MacOS WinXP Solaris Java HW

Portable The bytecode can run on virtual machines (VM) above different operating systems : MacOS Windows95/NT/CE/XP/Vista Solaris OS2 etc It can also run directly on hardware.

High - Performance Multithreading allows more than one task in a program. With JIT compilers the interpreted code compiles at run time and gives almost native code speed. Java Bytecode Native JIT Java VM Operating System Hardware Java OS Java HW

Dynamic Java has been built to support the development of dynamically extendable systems. Java provides dynamic linking of the binary code at runtime.

Java s Genealogy

Java : Types of Programs Applets : Execute on HTML Browsers. Have severe security restrictions. GUI Applications : Are Interpreted and Executed. Use the current s platform s GUI widgets. Mostly use Java s AWT or JFC packages. Console Applications : Simple Text Console.

JDK basic tools javac (Compiler).java->.class The Java Language Compiler that you use to compile programs written in Java into bytecodes. Example : javac HelloWorld.java java (Interpreter) executes.class The Interpreter that you use to run programs written in Java. Example : java HelloWorld javadoc (Doc. generator).java html Generates documentation in HTML format from Java source code. Example : javadoc HelloWorld.java

The First Java Program Filename: HelloWorld.java public class HelloWorld { } public static void main(string argv[] ) { System.out.println("Hello World!!!"); }

CourseMarker CourseMarker is a Courseware system that provides for : The presentation of Information summaries, notes, coursework questions, hints, daily messages The administration of coursework coursework delivery, submission management, overall class management The automatic assessment of coursework solution space modeling, assessment and feedback mechanisms, plagiarism checking tools

Logging in CM client: To login to CM you need both a windows and a unix password. Once you are in windows you can click the CM icon This will get you to the login screen : Unix Password!

Message of the day : Informs you about the latest in exercises Do read it!

CourseMarker Course Level : Options Exit MOTD Notes Summary

CourseMarker Unit Level Notes Summary

CourseMarker Exercise Level : Setup Develop Submit Question View TD Marks Run Run TD

Setup : Puts the skeleton source and other files in your working area Do not setup over your solution

Unix / JCreator For early exercises use your favourite editor under Unix/Windows (notepad?) and compile by hand (via java & javac) For subsequent exercises use Eclipse (you can use anything else you like, but support will not be provided)

Submit After having developed the solution you need to refresh the CM browser by refreshing the course tree structure. You will be asked to confirm and then wait for the result. Expanded Result tree Submission Number Feedback for every check

Other Options : View TD : Allows you to see the testing input that CM uses for the particular exercise. Marks : Allows you to check the exercise s last submission Options : Allows you to change : Visual properties. Editor command.

Summary Background Teaching Staff Course Details Assessment PR1 Summary Resources Programming Programming Languages High Level Languages Interpreters / Compilers Introduction to Java Java History Java Properties Types of Programs JDK tools The HelloWorld program Using CourseMarker