Road to Object Oriented Programming

Slides:



Advertisements
Similar presentations
Object Orientated Programming
Advertisements

OOP & JAVA. HelloWorld.java /** * The HelloWorld class is an application that * displays "Hello World!" to the standard output. */ public class HelloWorld.
Aalborg Media Lab 21-Jun-15 Software Design Lecture 1 “ Introduction to Java and OOP”
Java Intro. A First Java Program //The Hello, World! program in Java public class Hello { public static void main(String[] args) { System.out.println("Hello,
Slide 1 of 40. Lecture A The Java Programming Language Invented 1995 by James Gosling at Sun Microsystems. Based on previous languages: C, C++, Objective-C,
Introduction to Java.
Lecture 1: Overview of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed.
Getting Started with Java
Java PAL.  Contains the development kit and the runtime environment ( aka the Java Virtual Machine )  Download Link:
IB Computer Science II Paul Bui
Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
Lecture 1 Introduction to Java MIT- AITI 2004 What is a Computer Program? For a computer to be able to do anything (multiply, play a song, run a word.
+ Java vs. Javascript Jessi Style. + Java Compiled Can stand on its own Written once, run anywhere Two-stage debugging Java is an Object Oriented Programming.
(C) 2010 Pearson Education, Inc. All rights reserved.  Java programs normally go through five phases  edit  compile  load  verify  execute.
Basics Programming Concepts. Basics A computer program is a set of instructions to tell a computer what to do Machine language = circuit level language.
Sadegh Aliakbary Sharif University of Technology Fall 2011.
An intro to programming. The purpose of writing a program is to solve a problem or take advantage of an opportunity Consists of multiple steps:  Understanding.
Tutorial 1. Q1: Compare and contrast between multiprocessors and multicore Multicore – Dual-core processor has two cores (e.g. AMD Phenom II X2, Intel.
Computer Programming 12 Mr. Jean March 19 th, 2013.
Lecture 1 Introduction to Java MIT-AITI Ethiopia 2004.
Sadegh Aliakbary. Copyright ©2014 JAVACUP.IRJAVACUP.IR All rights reserved. Redistribution of JAVACUP contents is not prohibited if JAVACUP.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and Server Side Programming Very rich GUI libraries Portability (machine independence) A.
Lesson 2: First Java Programs. Objectives: –Discuss why Java is an important programming language. –Explain the Java virtual machine and byte code. –Choose.
CS 11 java track: lecture 1 Administrivia need a CS cluster account cgi-bin/sysadmin/account_request.cgi need to know UNIX
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
Week 1 - Friday.  What did we talk about last time?  Our first Java program.
Aspect Oriented Programming Sumathie Sundaresan CS590 :: Summer 2007 June 30, 2007.
Objected Oriented Programming & Design JAVA Shishir Gupta (704) (704)
Compiling and the Java Virtual Machine (JVM). The syntax of Pseudocode is pretty loose –visual validation encourages a permissive approach –emphasized.
C# Versus Java Author: Eaddy, Marc Source: Software Tools for the Professional Programmer. Dr. Dobb's Journal. Feb2001, Vol. 26 Issue 2, p74 Hong Lu CS699A.
Object Oriented Programming Lecture 3. Introduction  In discussing Java, some items need to be clarified  The Java programming language  The Java virtual.
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
4-Nov-15 Air Force Institute of Technology Electrical and Computer Engineering Object-Oriented Programming Design Topic 1: The Java Environment Maj Joel.
Pre-Sessional Java Programming Lecture 1a Reyer Zwiggelaar
JAVA Practical Creating our first program 2. Source code file 3. Class file 4. Understanding the different parts of our program 5. Escape characters.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and web applications Very rich GUI libraries Portability (machine independence) A real Object.
 Instructor: Dr. Jason Nichols –  Office Hours: – 9:30-10:30 M/W/F or by appointment – Business Building.
CSI 3125, Preliminaries, page 1 Compiling the Program.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
©2016 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. CSC 110 – INTRO TO COMPUTING - PROGRAMMING Overview of Programming.
3/5/2002e-business and Information Systems1 Java Java Java Virtual Machine (JVM) Java Application Program Interface (API) HW Kernel API Application Programs.
Java How to Program, 9/e Presented by: José M. Reyes Álamo © by Pearson Education, Inc. All Rights Reserved.
ITP 109 Week 2 Trina Gregory Introduction to Java.
Execution ways of program References: www. en.wikipedia.org/wiki/Integrated_development_environment  You can execute or run a simple java program with.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
Learning Plan 6 Java Programming Intro to Object Oriented Programming.
CS 201 Lecture 1 (b) Using an IDE Tarik Booker CS 201: Introduction to Programming California State University, Los Angeles.
SESSION 1 Introduction in Java. Objectives Introduce classes and objects Starting with Java Introduce JDK Writing a simple Java program Using comments.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
CS-140 Dick Steflik Lecture 3. Java C++ Interpreted optimized for the internet Runs on virtual ized machine Derived from C++ Good object model Widely.
Introduction to programming in java
CS210 Intermediate Computing with Data Structures (Java)
Lecture 1b- Introduction
The eclipse IDE IDE = “Integrated Development Environment”
Unit-1 JAVA Programming.
Text by: Lambert and Osborne
Chapter 2 First Java Programs
Programming without BlueJ Week 12
CompSci 230 Software Construction
Introduction to Java Dept. Business Computing University of Winnipeg
Getting Started ARCS Lab..
Your First Java Application
How to Run a Java Program
Advanced Programming Behnam Hatami Fall 2017.
Java Intro.
IB Computer Science II Paul Bui
Chap 1. Getting Started Objectives
Chap 4. Programming Fundamentals
Outcome of the Lecture Upon completion of this lecture you will be able to understand Fundamentals and Characteristics of Java Language Basic Terminology.
Presentation transcript:

Road to Object Oriented Programming Advanced programming ce244 Sharif University of Technology Feb 2007 Sunday, February 18, 2007 Taha Abachi

Outline Deadlines Objects Object Oriented Languages Editing your first java program Compiling, running and debugging Homework 5/5/2019 Taha Abachi

Deadlines By the end of the week you should have : The Java CD Java installed on your machines Edited, run, debugged your first Java programs without any trouble Examined Java IDEs 5/5/2019 Taha Abachi

Objects Abstraction Definition Programming languages Problem space State : internal data Behavior : methods Identity : each object can be uniquely distinguished from every other object 5/5/2019 Taha Abachi

Features of an Object An object has an interface An object provides services The hidden implementation Data encapsulation Reusing the implementation Inheritance:reusing the interface 5/5/2019 Taha Abachi

Features of an Object (cont’d) Sample object Date : Day : 1..31 Month : 1..12 Year : 1300..1500 Problems Inconsistent data: no dependency to other fields Day := 32 Inflexible representation Date : longint Date := 28351 days passed after a specific date 5/5/2019 Taha Abachi

Features of an Object (cont’d) Clients of the code Yourself Teammates Customers An infant programmer Solution : Separating implementation form interface More Secure and flexible 5/5/2019 Taha Abachi

Object Oriented Languages Everything is an object. A program is a bunch of objects telling each other what to do by sending messages. Each object has its own memory made up of other objects. Every object has a type. All objects of a particular type can receive the same messages. 5/5/2019 Taha Abachi

Installing Java Install JDK Install Java Documentation API(Application programming Interface) Set Environment variables Choose a text editor 5/5/2019 Taha Abachi

Java Characteristics Portability : Interpreting : JVM compile programs to a intermediary format called JBC C:\>javac HelloWorld.java to produce HelloWorld.class Interpreting : JVM 5/5/2019 Taha Abachi

Portability 5/5/2019 Taha Abachi

Java is Object Oriented Every thing in Java is an Object. Objects in OOP mirror the properties and behavior of the real world objects. They have their own set of data and functions (called method) that operate on these data. 5/5/2019 Taha Abachi

First Program in Java Use a text editor Write down your program Java is case sensitive Compile your program Run 5/5/2019 Taha Abachi

HelloWorld public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World"); } 5/5/2019 Taha Abachi

Java program files Each class is saved in a file of the same name with java extension. Note java is case sensitive language, even as far as the class file names are concerned. The Hello class should be saved in a file called HelloWorld.java class . 5/5/2019 Taha Abachi

Syntax Highlighting public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World"); } 5/5/2019 Taha Abachi

The method main ( ) The main() method is the point where a Java program starts running. Any executable Java class must have the main() method in this specific format: public static void main(String[ ] args){ ………….. } 5/5/2019 Taha Abachi

Time to compile Use javac command to compile your java programms : C:\> javac HelloWorld.java HelloWorld.class (JBC file) is created You may face some errors Correct erroneous parts and compile again 5/5/2019 Taha Abachi

Run The Java command is used to run the class (JBC) file: c:\> Java HelloWorld 5/5/2019 Taha Abachi

You are a Java programmer NOW! Congratulations You are a Java programmer NOW! 5/5/2019 Taha Abachi

Java Development Environments Sun's JDK is not an environment. Sun's Java Workshop Microsoft's Visual J++ Symantec's Cafe Borland's J Builder Metrowerks' Code Warrior Tek-Tools' Kawa. 5/5/2019 Taha Abachi

Java Development Environments My candidates : IntelliJ IDEA Eclipse Textpad 5/5/2019 Taha Abachi

Homework Install Java properly Write and Test you first Java program Design an object oriented environment for manipulating geometrical shapes : Different subtypes (square, circle, etc.) Common characteristics (fields & methods) Particular characteristics Use UML (Unified Modeling Language) notation 5/5/2019 Taha Abachi

Questions? 5/5/2019 Taha Abachi