SlideShare a Scribd company logo
Introduction to
Java Programming
Vibrant Technology & Computers
Vashi,Navi Mumbai
2www.vibranttechnologies.co.in
3www.vibranttechnologies.co.in
4
Introduction
Java is a programming language and computing platform first released
by Sun Microsystems in 1995. There are lots of applications and
websites that will not work unless you have Java installed, and more
are created every day. Java is fast, secure, and reliable.
From laptops to datacenters, game consoles to scientific
supercomputers, cell phones to the Internet, Java is everywhere!
Java allows you to play online games, chat with people around the
world, calculate your mortgage interest, and view images in 3D, just to
name a few.
It's also integral to the intranet applications and other e-business
solutions that are the foundation of corporate computing.
www.vibranttechnologies.co.in
5
Course Objectives
Upon completing the course, you will understand
– Create, compile, and run Java programs
– Primitive data types
– Java control flow
– Methods
– Arrays (for teaching Java in two semesters, this could be the end)
– Object-oriented programming
– Core Java classes (Swing, exception, internationalization,
multithreading, multimedia, I/O, networking, Java
Collections Framework)
www.vibranttechnologies.co.in
6
Course Objectives, cont.
You will be able to
– Develop programs using Forte
– Write simple programs using primitive data
types, control statements, methods, and arrays.
– Create and use methods
– Develop a GUI interface and Java applets
– Write interesting projects
– Establish a firm foundation on Java concepts
www.vibranttechnologies.co.in
7
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
www.vibranttechnologies.co.in
8
Book Chapters, cont.
Part II: Object-Oriented Programming
– Chapter 6 Objects and Classes
– Chapter 7 Strings
– Chapter 8 Class Inheritance and Interfaces
– Chapter 9 Object-Oriented Software Development
www.vibranttechnologies.co.in
9
Book Chapters, cont.
Part III: GUI Programming
– Chapter 10 Getting Started with GUI Programming
– Chapter 11 Creating User Interfaces
– Chapter 12 Applets and Advanced GUI
www.vibranttechnologies.co.in
10
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
www.vibranttechnologies.co.in
11
Chapter 1 Introduction to Java
and Forte
What Is Java?
Getting Started With Java Programming
– Create, Compile and Running a Java
Application
www.vibranttechnologies.co.in
12
What Is Java?
History
Characteristics of Java
www.vibranttechnologies.co.in
13
History
James Gosling and Sun Microsystems
Oak
Java, May 20, 1995, Sun World
HotJava
– The first Java-enabled Web browser
JDK Evolutions
J2SE, J2ME, and J2EE (not mentioned in the
book, but could discuss here optionally)
www.vibranttechnologies.co.in
14
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
www.vibranttechnologies.co.in
15
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.3, 2000)
Java 2 SDK v 1.4 (a.k.a JDK 1.4, 2002)
www.vibranttechnologies.co.in
16
JDK Editions
Java Standard Edition (J2SE)
– J2SE can be used to develop client-side standalone
applications or applets.
Java Enterprise Edition (J2EE)
– J2EE can be used to develop server-side applications
such as Java servlets and Java ServerPages.
Java Micro Edition (J2ME).
– J2ME can be used to develop applications for mobile
devices such as cell phones.
This book uses J2SE to introduce Java
programming.
www.vibranttechnologies.co.in
17
Java IDE Tools
Forte by Sun MicroSystems
Borland JBuilder
Microsoft Visual J++
WebGain Café
IBM Visual Age for Java
www.vibranttechnologies.co.in
18
Getting Started with Java
Programming
A Simple Java Application
Compiling Programs
Executing Applications
www.vibranttechnologies.co.in
19
A Simple Application
Example 1.1
//This application program prints Welcome
//to Java!
package chapter1;
public class Welcome {
public static void main(String[] args) {
System.out.println("Welcome to Java!");
}
}
RunRunSourceSource
NOTE: To run the program,
install slide files on hard
disk.www.vibranttechnologies.co.in
20
Creating and Compiling Programs
On command line
– javac file.java Source Code
Create/Modify Source Code
Compile Source Code
i.e. javac Welcome.java
Bytecode
Run Byteode
i.e. java Welcome
Result
If compilation errors
If runtime errors or incorrect result
www.vibranttechnologies.co.in
21
Executing Applications
On command line
– java classname
Java
Interpreter
on Windows
Java
Interpreter
on Sun Solaris
Java
Interpreter
on Linux
Bytecode
...
www.vibranttechnologies.co.in
22
Example
javac Welcome.java
java Welcome
output:...
www.vibranttechnologies.co.in
23
Compiling and Running a Program
Where are the files
stored in the
directory?c:example
chapter1 Welcome.class
Welcome.java
chapter2
.
.
.
Java source files and class files for Chapter 2
chapter19 Java source files and class files for Chapter 19
Welcome.java~
www.vibranttechnologies.co.in
24
Anatomy of a Java Program
Comments
Package
Reserved words
Modifiers
Statements
Blocks
Classes
Methods
The main method
www.vibranttechnologies.co.in
25
Comments
In Java, comments are
preceded by two slashes (//)
in a line, or enclosed
between /* and */ in one or
multiple lines. When the
compiler sees //, it ignores
all text after // in the
same line. When it sees /*,
www.vibranttechnologies.co.in
26
Package
The second line in the program
(package chapter1;) specifies a package
name, chapter1, for the class Welcome.
Forte compiles the source code in
Welcome.java, generates
Welcome.class, and stores
Welcome.class in the chapter1 folder.
www.vibranttechnologies.co.in
27
Reserved Words
Reserved words or keywords are
words that have a specific
meaning to the compiler and
cannot be used for other
purposes in the program. For
example, when the compiler sees
the word class, it understands
that the word after class is the
name for the class. Other
reserved words in Example 1.1
www.vibranttechnologies.co.in
28
Modifiers
Java uses certain reserved words called
modifiers that specify the properties of the
data, methods, and classes and how they
can be used. Examples of modifiers are
public and static. Other modifiers are
private, final, abstract, and protected. A
public datum, method, or class can be
accessed by other programs. A private
datum or method cannot be accessed by
other programs. Modifiers are discussed in
Chapter 6, "Objects and Classes."www.vibranttechnologies.co.in
29
Statements
A statement represents an
action or a sequence of
actions. The statement
System.out.println("Welcome
to Java!") in the program in
Example 1.1 is a statement
to display the greeting
"Welcome to Java!" Every
statement in Java ends withwww.vibranttechnologies.co.in
30
Blocks
A pair of braces in a program
forms a block that groups
components of a program.
public class Test {
public static void main(String[] args) {
System.out.println("Welcome to Java!");
}
}
Class block
Method block
www.vibranttechnologies.co.in
31
Classes
The class is the essential Java
construct. A class is a template
or blueprint for objects. To
program in Java, you must
understand classes and be able
to write and use them. The
mystery of the class will
continue to be unveiled
throughout this book. For now,
though, understand that awww.vibranttechnologies.co.in
32
Methods
What is System.out.println? It is a method: a
collection of statements that performs a
sequence of operations to display a
message on the console. It can be used
even without fully understanding the
details of how it works. It is used by
invoking a statement with a string
argument. The string argument is enclosed
within parentheses. In this case, the
argument is "Welcome to Java!" You can
call the same println method with awww.vibranttechnologies.co.in
33
main Method
The main method provides the
control of program flow. The
Java interpreter executes the
application by invoking the main
method.
The main method looks like this:
public static void main(String[]
args) { www.vibranttechnologies.co.in
34
Displaying Text in a Message
Dialog Box
you can use the showMessageDialog
method in the JOptionPane class.
JOptionPane is one of the many
predefined classes in the Java system,
which can be reused rather than
“reinventing the wheel.”
RunRunSourceSource
www.vibranttechnologies.co.in
35
The showMessageDialog Method
JOptionPane.showMessageDialog(null, "Welcome
to Java!",
"Example 1.2",
JOptionPane.INFORMATION_MESSAGE));
www.vibranttechnologies.co.in
36
The exit Method
Use Exit to terminate the program and stop
all threads.
NOTE: When your program starts, a thread
is spawned to run the program. When the
showMessageDialog is invoked, a separate
thread is spawned to run this method. The
thread is not terminated even you close the
dialog box. To terminate the thread, you
have to invoke the exit method.
www.vibranttechnologies.co.in
37www.vibranttechnologies.co.in
Thank You…
38www.vibranttechnologies.co.in

More Related Content

PDF
Professional-core-java-training
PPSX
Java Semimar Slide (Cetpa)
PPT
Professional-core-java-training
PPT
Classes and Objects
DOCX
Java Tutorial to Learn Java Programming
PDF
Java Tutorial For Beginners - Step By Step | Java Basics | Java Certification...
PDF
A seminar report on core java
DOCX
JAVA CORE
Professional-core-java-training
Java Semimar Slide (Cetpa)
Professional-core-java-training
Classes and Objects
Java Tutorial to Learn Java Programming
Java Tutorial For Beginners - Step By Step | Java Basics | Java Certification...
A seminar report on core java
JAVA CORE

What's hot (18)

DOCX
Introduction to java
PPT
bai giang java co ban - java cơ bản - bai 1
DOCX
Core java tutorial
PDF
Java Programming Basics
PPTX
JAVA Training Syllabus Course
PPTX
Java Programming
PPSX
CR Bridge Solutions Pvt Ltd. Java slides
PDF
Bn1005 demo ppt core java
PDF
Curso de Programación Java Intermedio
PPTX
Curso de Programación Java Básico
PDF
Core java course syllabus
PDF
Java exam 2017
PDF
Introduction to java
PDF
Summer training report on java se6 technology
DOCX
Core Java Training report
PPT
Core Java Slides
PDF
130700548484460000
PPTX
Structure programming – Java Programming – Theory
Introduction to java
bai giang java co ban - java cơ bản - bai 1
Core java tutorial
Java Programming Basics
JAVA Training Syllabus Course
Java Programming
CR Bridge Solutions Pvt Ltd. Java slides
Bn1005 demo ppt core java
Curso de Programación Java Intermedio
Curso de Programación Java Básico
Core java course syllabus
Java exam 2017
Introduction to java
Summer training report on java se6 technology
Core Java Training report
Core Java Slides
130700548484460000
Structure programming – Java Programming – Theory
Ad

Viewers also liked (16)

PPTX
Drupal Updates automatisieren - Gut oder Böse?
PDF
Gcc para plataformawindows
PDF
Ania Jaworska Sou Fujimoto Object Design Midterm
DOC
Executive Compensation HRMG 725
DOCX
PDF
Manuale di posa per rivestimento parete Novowood legno composito
PPTX
Exterior renderings WIP
PDF
Centos+5+espa c3 b1ol
DOCX
The Ethical Practices of Tourists in Callao Cave
PDF
Gcc para plataformawindows
PDF
Newsletter
PPTX
Segunda expo
PPTX
10 Tips to Improve Testing
PPTX
Pick and place mechanism
ODP
Sofia y julian
PDF
Geografiya expres pidgotovka_litera_2012
Drupal Updates automatisieren - Gut oder Böse?
Gcc para plataformawindows
Ania Jaworska Sou Fujimoto Object Design Midterm
Executive Compensation HRMG 725
Manuale di posa per rivestimento parete Novowood legno composito
Exterior renderings WIP
Centos+5+espa c3 b1ol
The Ethical Practices of Tourists in Callao Cave
Gcc para plataformawindows
Newsletter
Segunda expo
10 Tips to Improve Testing
Pick and place mechanism
Sofia y julian
Geografiya expres pidgotovka_litera_2012
Ad

Similar to Java course-in-mumbai (20)

PPT
Java Standard edition(Java ) programming Basics for beginner's
PPT
Java course-in-mumbai
PPTX
Unit1- OOPJ Chapter-1 Object Oriented Programming JAVA.pptx
PDF
Java programming Evolution-OverviewOfJava.pdf
PPTX
1_Introduction to Java.pptx java programming
PPTX
Object oriented programming
PPTX
Object oriented programming-with_java
PPTX
Object oriented programming-with_java
PPTX
Object oriented programming
PPTX
Object oriented programming-with_java
PPTX
Object oriented programming
PPTX
Object oriented programming
PPTX
Unit1- OOPJ(OO Using JAVA) Chapter-1.pptx
PDF
Introduction to Java Programming.pdf
PDF
Java Programming
PPTX
Introduction to java
PDF
Learn Advanced Java Programming With Beginners Md Pulok
Java Standard edition(Java ) programming Basics for beginner's
Java course-in-mumbai
Unit1- OOPJ Chapter-1 Object Oriented Programming JAVA.pptx
Java programming Evolution-OverviewOfJava.pdf
1_Introduction to Java.pptx java programming
Object oriented programming
Object oriented programming-with_java
Object oriented programming-with_java
Object oriented programming
Object oriented programming-with_java
Object oriented programming
Object oriented programming
Unit1- OOPJ(OO Using JAVA) Chapter-1.pptx
Introduction to Java Programming.pdf
Java Programming
Introduction to java
Learn Advanced Java Programming With Beginners Md Pulok

Recently uploaded (20)

PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Machine Learning_overview_presentation.pptx
PPT
Teaching material agriculture food technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Approach and Philosophy of On baking technology
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Empathic Computing: Creating Shared Understanding
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
cuic standard and advanced reporting.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Machine Learning_overview_presentation.pptx
Teaching material agriculture food technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Approach and Philosophy of On baking technology
The Rise and Fall of 3GPP – Time for a Sabbatical?
Empathic Computing: Creating Shared Understanding
Spectral efficient network and resource selection model in 5G networks
cuic standard and advanced reporting.pdf
Encapsulation_ Review paper, used for researhc scholars
NewMind AI Weekly Chronicles - August'25-Week II
Dropbox Q2 2025 Financial Results & Investor Presentation
Digital-Transformation-Roadmap-for-Companies.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Big Data Technologies - Introduction.pptx
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton

Java course-in-mumbai

  • 1. Introduction to Java Programming Vibrant Technology & Computers Vashi,Navi Mumbai
  • 4. 4 Introduction Java is a programming language and computing platform first released by Sun Microsystems in 1995. There are lots of applications and websites that will not work unless you have Java installed, and more are created every day. Java is fast, secure, and reliable. From laptops to datacenters, game consoles to scientific supercomputers, cell phones to the Internet, Java is everywhere! Java allows you to play online games, chat with people around the world, calculate your mortgage interest, and view images in 3D, just to name a few. It's also integral to the intranet applications and other e-business solutions that are the foundation of corporate computing. www.vibranttechnologies.co.in
  • 5. 5 Course Objectives Upon completing the course, you will understand – Create, compile, and run Java programs – Primitive data types – Java control flow – Methods – Arrays (for teaching Java in two semesters, this could be the end) – Object-oriented programming – Core Java classes (Swing, exception, internationalization, multithreading, multimedia, I/O, networking, Java Collections Framework) www.vibranttechnologies.co.in
  • 6. 6 Course Objectives, cont. You will be able to – Develop programs using Forte – Write simple programs using primitive data types, control statements, methods, and arrays. – Create and use methods – Develop a GUI interface and Java applets – Write interesting projects – Establish a firm foundation on Java concepts www.vibranttechnologies.co.in
  • 7. 7 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 www.vibranttechnologies.co.in
  • 8. 8 Book Chapters, cont. Part II: Object-Oriented Programming – Chapter 6 Objects and Classes – Chapter 7 Strings – Chapter 8 Class Inheritance and Interfaces – Chapter 9 Object-Oriented Software Development www.vibranttechnologies.co.in
  • 9. 9 Book Chapters, cont. Part III: GUI Programming – Chapter 10 Getting Started with GUI Programming – Chapter 11 Creating User Interfaces – Chapter 12 Applets and Advanced GUI www.vibranttechnologies.co.in
  • 10. 10 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 www.vibranttechnologies.co.in
  • 11. 11 Chapter 1 Introduction to Java and Forte What Is Java? Getting Started With Java Programming – Create, Compile and Running a Java Application www.vibranttechnologies.co.in
  • 12. 12 What Is Java? History Characteristics of Java www.vibranttechnologies.co.in
  • 13. 13 History James Gosling and Sun Microsystems Oak Java, May 20, 1995, Sun World HotJava – The first Java-enabled Web browser JDK Evolutions J2SE, J2ME, and J2EE (not mentioned in the book, but could discuss here optionally) www.vibranttechnologies.co.in
  • 14. 14 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 www.vibranttechnologies.co.in
  • 15. 15 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.3, 2000) Java 2 SDK v 1.4 (a.k.a JDK 1.4, 2002) www.vibranttechnologies.co.in
  • 16. 16 JDK Editions Java Standard Edition (J2SE) – J2SE can be used to develop client-side standalone applications or applets. Java Enterprise Edition (J2EE) – J2EE can be used to develop server-side applications such as Java servlets and Java ServerPages. Java Micro Edition (J2ME). – J2ME can be used to develop applications for mobile devices such as cell phones. This book uses J2SE to introduce Java programming. www.vibranttechnologies.co.in
  • 17. 17 Java IDE Tools Forte by Sun MicroSystems Borland JBuilder Microsoft Visual J++ WebGain Café IBM Visual Age for Java www.vibranttechnologies.co.in
  • 18. 18 Getting Started with Java Programming A Simple Java Application Compiling Programs Executing Applications www.vibranttechnologies.co.in
  • 19. 19 A Simple Application Example 1.1 //This application program prints Welcome //to Java! package chapter1; public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); } } RunRunSourceSource NOTE: To run the program, install slide files on hard disk.www.vibranttechnologies.co.in
  • 20. 20 Creating and Compiling Programs On command line – javac file.java Source Code Create/Modify Source Code Compile Source Code i.e. javac Welcome.java Bytecode Run Byteode i.e. java Welcome Result If compilation errors If runtime errors or incorrect result www.vibranttechnologies.co.in
  • 21. 21 Executing Applications On command line – java classname Java Interpreter on Windows Java Interpreter on Sun Solaris Java Interpreter on Linux Bytecode ... www.vibranttechnologies.co.in
  • 23. 23 Compiling and Running a Program Where are the files stored in the directory?c:example chapter1 Welcome.class Welcome.java chapter2 . . . Java source files and class files for Chapter 2 chapter19 Java source files and class files for Chapter 19 Welcome.java~ www.vibranttechnologies.co.in
  • 24. 24 Anatomy of a Java Program Comments Package Reserved words Modifiers Statements Blocks Classes Methods The main method www.vibranttechnologies.co.in
  • 25. 25 Comments In Java, comments are preceded by two slashes (//) in a line, or enclosed between /* and */ in one or multiple lines. When the compiler sees //, it ignores all text after // in the same line. When it sees /*, www.vibranttechnologies.co.in
  • 26. 26 Package The second line in the program (package chapter1;) specifies a package name, chapter1, for the class Welcome. Forte compiles the source code in Welcome.java, generates Welcome.class, and stores Welcome.class in the chapter1 folder. www.vibranttechnologies.co.in
  • 27. 27 Reserved Words Reserved words or keywords are words that have a specific meaning to the compiler and cannot be used for other purposes in the program. For example, when the compiler sees the word class, it understands that the word after class is the name for the class. Other reserved words in Example 1.1 www.vibranttechnologies.co.in
  • 28. 28 Modifiers Java uses certain reserved words called modifiers that specify the properties of the data, methods, and classes and how they can be used. Examples of modifiers are public and static. Other modifiers are private, final, abstract, and protected. A public datum, method, or class can be accessed by other programs. A private datum or method cannot be accessed by other programs. Modifiers are discussed in Chapter 6, "Objects and Classes."www.vibranttechnologies.co.in
  • 29. 29 Statements A statement represents an action or a sequence of actions. The statement System.out.println("Welcome to Java!") in the program in Example 1.1 is a statement to display the greeting "Welcome to Java!" Every statement in Java ends withwww.vibranttechnologies.co.in
  • 30. 30 Blocks A pair of braces in a program forms a block that groups components of a program. public class Test { public static void main(String[] args) { System.out.println("Welcome to Java!"); } } Class block Method block www.vibranttechnologies.co.in
  • 31. 31 Classes The class is the essential Java construct. A class is a template or blueprint for objects. To program in Java, you must understand classes and be able to write and use them. The mystery of the class will continue to be unveiled throughout this book. For now, though, understand that awww.vibranttechnologies.co.in
  • 32. 32 Methods What is System.out.println? It is a method: a collection of statements that performs a sequence of operations to display a message on the console. It can be used even without fully understanding the details of how it works. It is used by invoking a statement with a string argument. The string argument is enclosed within parentheses. In this case, the argument is "Welcome to Java!" You can call the same println method with awww.vibranttechnologies.co.in
  • 33. 33 main Method The main method provides the control of program flow. The Java interpreter executes the application by invoking the main method. The main method looks like this: public static void main(String[] args) { www.vibranttechnologies.co.in
  • 34. 34 Displaying Text in a Message Dialog Box you can use the showMessageDialog method in the JOptionPane class. JOptionPane is one of the many predefined classes in the Java system, which can be reused rather than “reinventing the wheel.” RunRunSourceSource www.vibranttechnologies.co.in
  • 35. 35 The showMessageDialog Method JOptionPane.showMessageDialog(null, "Welcome to Java!", "Example 1.2", JOptionPane.INFORMATION_MESSAGE)); www.vibranttechnologies.co.in
  • 36. 36 The exit Method Use Exit to terminate the program and stop all threads. NOTE: When your program starts, a thread is spawned to run the program. When the showMessageDialog is invoked, a separate thread is spawned to run this method. The thread is not terminated even you close the dialog box. To terminate the thread, you have to invoke the exit method. www.vibranttechnologies.co.in

Editor's Notes

  • #2: First Class: Introduction, Prerequisites, Advices, Syllabus Lab 1: Create a Java Project, Compile, and Run. Show syntax errors Print program Capture screen shots, and save it in Word, and print it. Homework One: Check in the class randomly.