1 Part I : Chapter 01 Introduction to Java Programming.

Slides:



Advertisements
Similar presentations
Liang, Introduction to Java Programming, Sixth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to.
Advertisements

Java: History and Introduction (Lecture # 1). History… Java – Based on C and C++ – Developed in 1991 for intelligent consumer electronic devices – Green.
Introduction To Computers and Programming Lecture 2: Your first program Professor: Evan Korth New York University.
Introduction to Java Kiyeol Ryu Java Programming Language.
Excerpts from Introduction to Java Programming, 4E Author: Y. Daniel Liang (Copyright by Prentice Hall)
Introduction to Java Programming, 4E
Chapter 2 - Introduction to Java Applications
Chapter 3 - Introduction to Java Applets Outline 3.1Introduction 3.2Thinking About Objects 3.4A Simple Java Applet: Drawing a String 3.5Two More Simple.
Programming Software Applications Week 1 Dr. Xiaohong Gao Trent Park – B107, ext. 2252
 2000 Prentice Hall, Inc. All rights reserved. Chapter 24 - Introduction to Java Applications and Applets Outline 24.1Introduction 24.2Basics of a Typical.
A little cup of Java-coffee CS404: CAI Class Presentation_01 By: Leo Sep, 2002.
JAVA: An Introduction to Problem Solving & Programming, 6 th Ed. By Walter Savitch ISBN © 2012 Pearson Education, Inc., Upper Saddle River,
01 Introduction to Java Technology. 2 Contents History of Java What is Java? Java Platforms Java Virtual Machine (JVM) Java Development Kit (JDK) Benefits.
LESSON 1 INTRODUCTION Compiled By: Edwin O. Okech [Tutor, Amoud University] JAVA PROGRAMMING.
BASIC JAVA PROGRAMMING TUTORIAL. History  James Gosling and Sun Microsystems  Oak  Java, May 20, 1995, Sun World  Hot Java –The first Java-enabled.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 24 - Introduction to Java Applications and Applets.
Introduction to Java Programming CS 21a: Introduction to Computing I Department of Information Systems and Computer Science Ateneo de Manila University.
Introduction to Java Programming with JBuilder 4
Introduction to Java Programming CS 21a: Introduction to Computing I First Semester,
S.W. Ma/CIM/LWL41211/2 Prog. IIA Page 1 HKIVE (Lee Wai Lee Campus) Department of CIM Course : Year 2 Module : Programming IIA Textbook : Introduction.
Chapter 1 Introduction to Computers, Programs, and Java 1.
Java Workshop for Teachers May 6, 2005 A Brief Look at the Java Programming Language.
Sadegh Aliakbary Sharif University of Technology Spring 2011.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Programming Languages Machine.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to Computers,
1 Chapter 1 Introduction to Computers, Programs, and Java.
Introduction to Java Programming. History F James Gosling and Sun Microsystems F Oak F Java, May 20, 1995, Sun World F HotJava –The first Java-enabled.
1.  At the end of this slide, student can:  Explore tools, features, properties and interface of the Textpad.  Creating a new project.  Open and run.
OOP (Java): Simple/ OOP (Java) Objectives – –give some simple examples of Java applications and one applet 2. Simple Java Programs Semester.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to.
Jaeki Song ISQS6337 JAVA Lecture 03 Introduction to Java -The First Java Application-
Chapter 1: Introduction to Programs, and Java 1. Objectives To review programs (§ ). To understand the relationship between Java and the World Wide.
POS 406 Java Technology And Beginning Java Code
Introduction to Java Programming with Forte Y. Daniel Liang.
CHAPTER 3 GC Java Fundamentals. 2 BASICS OF JAVA ENVIRONMENT  The environment  The language  Java applications programming Interface API  Various.
Applets. What is an applet? Why create applets instead of applications? – Applets are Java programs that can be embedded in an HTML document – In contrast,
24.1Introduction Java Powerful, object-oriented language Fun to use for beginners, appropriate for experience programmers Language of choice for Internet.
Introduction to Java Programming. Introduction Course Objectives Organization of the Book.
Java Applets. 2 Introduction to Java Applet Programs Applications are ___________________ programs –executed with Java interpreter Applet is a small program.
Java Programming Lecture 1 Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University
Introduction To JAVA By Ihtesham Ul Haq. Course Objectives Upon completing the course, you will understand Upon completing the course, you will understand.
JAVA PROGRAMMING BASICS CHAPTER 2. History of Java Begin with project Green in 1991 founded by Patrick Noughton, Mike Sheridan and James Gosling who worked.
 2000 Prentice Hall, Inc. All rights reserved. 1 Chapter 2 - Introduction to Java Applications Outline 2.1Introduction 2.2A Simple Program: Printing a.
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
1 COMP 241: Object-Oriented Programming with Java Fall 2004 Lecture 1 September 27, 2004 Serdar Taşıran.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to.
J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition Second Edition D.S. Malik D.S. Malik.
1 The JAVA Language Object Oriented Technology Mithani Binjan M.
Application Architecture Using Java Hong Li. Introduction Developed by a team led by James Gosling at Sun Microsystem. Originally called Oak, designed.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to.
Introduction to Java Programming. 2 Chapter 1 Introduction to Java and Forte F What Is Java? F Getting Started With Java Programming –Create, Compile.
introductory lecture on java programming
Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. 1 Chapter 1 Introduction.
Introduction to JAVA Programming
Introduction to Java Programming, 4E Y. Daniel Liang.
SESSION 1 Introduction in Java. Objectives Introduce classes and objects Starting with Java Introduce JDK Writing a simple Java program Using comments.
 It is a pure oops language and a high level language.  It was developed at sun microsystems by James Gosling.
Fundamental of Java Programming (630002) Unit – 1 Introduction to Java.
A Java Program: // Fig. 2.1: Welcome1.java // Text-printing program.
GC101 Introduction to computer and program
Chapter 1 Introduction to Computers, Programs, and Java
Chapter No. : 1 Introduction to Java.
Chapter 1 Introduction to Computers, Programs, and Java
Advanced Programming Fall 2017.
Chapter 2 - Introduction to Java Applications
Chapter 24 - Introduction to Java Applications and Applets
Chapter 1 Introduction to Computers, Programs, and Java
Java History, Editions, Version Features
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:

1 Part I : Chapter 01 Introduction to Java Programming

2 Objectives To learn about Java and its history. To create, compile, and run Java programs. To understand the Java runtime environment. To write a simple Java application.

3 History of Java Green Project Developed by a team led by James Gosling at Sun Microsystems. 1991: Oak (use in embedded consumer electronic application) 1995: Java (redesigned for developing Internet applications) James Gosling and Duke

4 History of Java This is a snapshot taken at a barbecue that James Gosling threw for some of the folks associated with the Green Team. From left to right they are: Al Frazier, Joe Palrang, Mike Sheridan, Ed Frank, Don Jackson, Faye Baxter, Patrick Naughton, Chris Warth, James Gosling, Bob Weisblatt, David Lavallee, and Jon Payne. Missing in action: Cindy Long, Chuck Clanton, Sheueling Chang, and Craig Forrest. (

5 Java Version History VersionCode-NameRelease Date JDK 1.1.4SparklerSept 12, 1997 JDK 1.1.5PumpkinDec 3, 1997 JDK 1.1.6AbigailApril 24, 1998 JDK 1.1.7BrutusSept 28, 1998 JDK 1.1.8ChelseaApril 8, 1999 J2SE 1.2PlaygroundDec 4, 1998 J2SE 1.2.1(none)March 30, 1999 J2SE 1.2.2CricketJuly 8, 1999 J2SE 1.3KestrelMay 8, 2000 J2SE 1.3.1LadybirdMay 17, 2001 J2SE 1.4.0MerlinFeb 13, 2002 J2SE 1.4.1HopperSept 16, 2002 J2SE 1.4.2MantisJune 26, 2003 J2SE 5.0 (1.5.0)TigerSept 29, 2004 Java SE 6.0 (1.6.0)MustangDecember 11, 2006 Java SE 6 Update 14 - May 28, 2009 Java SE 7.0 (1.7.0)DolphinPlan to release in 2010

6 Characteristics of Java Java is simple. Java is Object-Oriented Java is Case-sensitive Java is Interpreted (Write-Once, Run-Anywhere) Java is Robust Java is Multithreaded Java can be manipulated in two ways: Application and Applet

7 Platform of Java Technologies Java, Micro Edition (JME TM technology) Java, Standard Edition (JSE TM technology) Java, Enterprise Edition (JEE TM technology)

8 Platform of Java Technologies

9 Architecture of Java Java Programming Language Java class file Java Virtual Machine (Java VM) Java API Computer System Java platform API = Application Programming Interface

10 Typical Java Development Environment Java source code Java compiler (javac) HTML page Java Interpreter (java) Appletviewer or Browser Application Applet.java.class.html

11 Typical Java Development Environment Disk Primary Memory JVMEditorCompilerClass LoaderBytecode Verifier

12 Style of Java Programming Java application –Run in text mode –Run in GUI mode Java applet <applet code=“myApplet.class” width=… height=…>

13 Anatomy of the Application Program Comments Reserved Words Modifiers Statements Blocks Classes Methods The main method

14 Java Keywords abstractboolean break bytecase catchchar class constcontinue defaultdo double elseextend falsefinal finally floatfor gotoif implementation importinstanceof int interface long nativenew null package private protectedpublic return short static superswitch synchronized this throwthows transienttrue try voidvolatile while

15 The First Java Application Example // A first program in Java public class Welcome { public static void main ( String args[] ) { System.out.println(“Welcome to Java Programming”); } Begin class definition Declaration of main methodArguments of main method

16 The First Java Application Example System.out is a standard output object to display text in text mode println is a method of System.out To call a method, use. between a class / object’s name and the method –System.out.println(“…”); –car.getLevel();

17 The First Java Application Example Save as a name of Welcome.java compile Welcome.java –javac Welcome.java –See the output run –java Welcome –See the output

18 Java Application Example II // Printing multiple lines in a dialog box import javax.swing.JOptionPane; public class Welcome2 { public static void main (String args[] ) { JOptionPane.showMessageDialog ( null, “Welcome\nto\nJava\nProgramming!”); System.exit(0); // terminate the program }

19 Java Application Example II import javax.swing.JOptionPane; to call a class named JOptionPane into the class. JOptionPane.showMessageDialog ( null, “Welcome\nto\nJava\nProgramming!”); call a method named showMessageDialog of JOptionPane class. System.exit(0); is applied as the last command of the class to return resource to the system.

20 Java Application Example II Save the file as Welcome2.java compile Welcome2.java –javac Welcome2.java –See the output run –java Welcome2 –See the output

21 The First Applet // The first applet in Java import javax.swing.JApplet; import java.awt.Graphics; public class WelcomeApplet extends JApplet { public void paint ( Graphics g ) { g.drawString( “Welcome to Java Programming”, 25, 25 ); } inheritance

22 The First Applet Save the file as WelcomeApplet.java compile WelcomeApplet.java –javac WelcomeApplet.java –See the result run –Create a html file to call the applet –Save the.html file. Name the file in any name such as welcome.html –run by typing appletviewer welcome.html –Or call the.html in any browser program.

23 End of Chapter01 Introduction to Java