![Page 1: Introduction to Java Programming with JBuilder 4](https://reader035.vdocuments.site/reader035/viewer/2022062314/568135fc550346895d9d708c/html5/thumbnails/1.jpg)
Introduction to
Java Programming with JBuilder 4
Y. Daniel Liang
![Page 2: Introduction to Java Programming with JBuilder 4](https://reader035.vdocuments.site/reader035/viewer/2022062314/568135fc550346895d9d708c/html5/thumbnails/2.jpg)
Introduction
Course Objectives Organization of the Book
![Page 3: Introduction to Java Programming with JBuilder 4](https://reader035.vdocuments.site/reader035/viewer/2022062314/568135fc550346895d9d708c/html5/thumbnails/3.jpg)
Course Objectives Upon completing the course, you will understand
– Create, compile, and run Java programs– Primitive data types– Java control flow– Methods– Arrays– Object-oriented programming– Core Java classes (Swing, exception,
internationalization, multithreading, multimedia, I/O, networking, Java Collections Framework)
![Page 4: Introduction to Java Programming with JBuilder 4](https://reader035.vdocuments.site/reader035/viewer/2022062314/568135fc550346895d9d708c/html5/thumbnails/4.jpg)
Course Objectives, cont.
You will be able to – Write applications and applets– Develop a GUI interface– Write interesting projects– Establish a firm foundation on Java concepts
![Page 5: Introduction to Java Programming with JBuilder 4](https://reader035.vdocuments.site/reader035/viewer/2022062314/568135fc550346895d9d708c/html5/thumbnails/5.jpg)
Book Chapters Part I: Fundamentals of Programming
– Chapter 1 Introduction to Java
– Chapter 2 Primitive Data Types and Operations
– Chapter 3 Control Statements
– Chapter 4 Methods
– Chapter 5 Arrays
![Page 6: Introduction to Java Programming with JBuilder 4](https://reader035.vdocuments.site/reader035/viewer/2022062314/568135fc550346895d9d708c/html5/thumbnails/6.jpg)
Book Chapters, cont. Part II: Object-Oriented Programming
– Chapter 6 Programming with Objects and Classes
– Chapter 7 Strings
– Chapter 8 Class Inheritance and Interfaces
– Chapter 9 Object-Oriented Software Development
![Page 7: Introduction to Java Programming with JBuilder 4](https://reader035.vdocuments.site/reader035/viewer/2022062314/568135fc550346895d9d708c/html5/thumbnails/7.jpg)
Book Chapters, cont. Part III: Graphics Programming
– Chapter 10 Getting Started with Graphics
Programming
– Chapter 11 Creating User
Interfaces
– Chapter 12 Applets and Advanced
Graphics
![Page 8: Introduction to Java Programming with JBuilder 4](https://reader035.vdocuments.site/reader035/viewer/2022062314/568135fc550346895d9d708c/html5/thumbnails/8.jpg)
Book Chapters, cont. Part IV: Developing Comprehensive Projects
– Chapter 13 Exception Handling
– Chapter 14 Internationalization
– Chapter 15 Multithreading
– Chapter 16 Multimedia
– Chapter 17 Input and Output
– Chapter 18 Networking
– Chapter 19 Java Data Structures
![Page 9: Introduction to Java Programming with JBuilder 4](https://reader035.vdocuments.site/reader035/viewer/2022062314/568135fc550346895d9d708c/html5/thumbnails/9.jpg)
Chapter 1 Introduction to Java and JBuilder
What Is Java? Getting Started With Java Programming
– Create, Compile and Running a Java Application
![Page 10: Introduction to Java Programming with JBuilder 4](https://reader035.vdocuments.site/reader035/viewer/2022062314/568135fc550346895d9d708c/html5/thumbnails/10.jpg)
What Is Java?
History
Characteristics of Java
![Page 11: Introduction to Java Programming with JBuilder 4](https://reader035.vdocuments.site/reader035/viewer/2022062314/568135fc550346895d9d708c/html5/thumbnails/11.jpg)
History
James Gosling
Oak
Java, May 20, 1995, Sun World
HotJava – The first Java-enabled Web browser
![Page 12: Introduction to Java Programming with JBuilder 4](https://reader035.vdocuments.site/reader035/viewer/2022062314/568135fc550346895d9d708c/html5/thumbnails/12.jpg)
Characteristics of Java Java is simple
Java is object-oriented
Java is distributed
Java is interpreted
Java is robust
Java is secure
Java is architecture-neutral
Java is portable
Java’s performance
Java is multithreaded
Java is dynamic
![Page 13: Introduction to Java Programming with JBuilder 4](https://reader035.vdocuments.site/reader035/viewer/2022062314/568135fc550346895d9d708c/html5/thumbnails/13.jpg)
JDK Versions JDK 1.02 (1995) JDK 1.1 (1996) Java 2 SDK v 1.2 (a.k.a JDK 1.2, 1998) Java 2 SDK v 1.3 (a.k.a JDK 1.2, 2000)
![Page 14: Introduction to Java Programming with JBuilder 4](https://reader035.vdocuments.site/reader035/viewer/2022062314/568135fc550346895d9d708c/html5/thumbnails/14.jpg)
Java IDE Tools Inprise JBuilder
Microsoft Visual J++
Symantec Café
Forte by Sun MicroSystems
IBM Visual Age for Java
![Page 15: Introduction to Java Programming with JBuilder 4](https://reader035.vdocuments.site/reader035/viewer/2022062314/568135fc550346895d9d708c/html5/thumbnails/15.jpg)
Getting Started with Java Programming
A Simple Java Application
Compiling Programs
Executing Applications
A Simple Java Applet
Viewing Java Applets
Applications vs. Applets
![Page 16: Introduction to Java Programming with JBuilder 4](https://reader035.vdocuments.site/reader035/viewer/2022062314/568135fc550346895d9d708c/html5/thumbnails/16.jpg)
A Simple Application
Example 1.1//This application program prints Welcome
//to Java! public class Welcome { public static void main(String[] args) {
System.out.println("Welcome to Java!"); }}
RunRunSourceSource
![Page 17: Introduction to Java Programming with JBuilder 4](https://reader035.vdocuments.site/reader035/viewer/2022062314/568135fc550346895d9d708c/html5/thumbnails/17.jpg)
Compiling Programs
On command line– javac file.java
![Page 18: Introduction to Java Programming with JBuilder 4](https://reader035.vdocuments.site/reader035/viewer/2022062314/568135fc550346895d9d708c/html5/thumbnails/18.jpg)
Executing Applications
On command line– java classname
JavaInterpreter
on Windows
JavaInterpreter
on Sun Solaris
JavaInterpreteron Linux
Bytecode
...
![Page 19: Introduction to Java Programming with JBuilder 4](https://reader035.vdocuments.site/reader035/viewer/2022062314/568135fc550346895d9d708c/html5/thumbnails/19.jpg)
Example
javac Welcome.java
java Welcome
output:...
![Page 20: Introduction to Java Programming with JBuilder 4](https://reader035.vdocuments.site/reader035/viewer/2022062314/568135fc550346895d9d708c/html5/thumbnails/20.jpg)
JBuilder BasicsJBuilder IDE Interface
Create a JBuilder project
Create Java programs
Compile and run Java programs
![Page 21: Introduction to Java Programming with JBuilder 4](https://reader035.vdocuments.site/reader035/viewer/2022062314/568135fc550346895d9d708c/html5/thumbnails/21.jpg)
JBuilder IDE Interface
![Page 22: Introduction to Java Programming with JBuilder 4](https://reader035.vdocuments.site/reader035/viewer/2022062314/568135fc550346895d9d708c/html5/thumbnails/22.jpg)
Creating a JBuilder project
Choose File, New Project to display the project wizard
![Page 23: Introduction to Java Programming with JBuilder 4](https://reader035.vdocuments.site/reader035/viewer/2022062314/568135fc550346895d9d708c/html5/thumbnails/23.jpg)
Creating a JBuilder project, cont.
Verify Project path, source path, backup path, outpath
![Page 24: Introduction to Java Programming with JBuilder 4](https://reader035.vdocuments.site/reader035/viewer/2022062314/568135fc550346895d9d708c/html5/thumbnails/24.jpg)
Creating a JBuilder project, cont.
Optional project description
![Page 25: Introduction to Java Programming with JBuilder 4](https://reader035.vdocuments.site/reader035/viewer/2022062314/568135fc550346895d9d708c/html5/thumbnails/25.jpg)
Creating a Java Program
Choose File, New Class to display the class wizard
![Page 26: Introduction to Java Programming with JBuilder 4](https://reader035.vdocuments.site/reader035/viewer/2022062314/568135fc550346895d9d708c/html5/thumbnails/26.jpg)
Compiling and Running a Program
Where are the files stored in the directory?
c:\example
chapter1.jpr
chapter1.html
chapter1
Welcome.java
Welcome.class
chapter1 Welcome.java~1~
chapter2
.
.
.
Java source files and class files for Chapter 2
chapter19 Java source files and class files for Chapter 19
bak
chapter2 Backup files for Chapter 2
.
.
. chapter19 Backup files for Chapter 19