Introduction to Java and Applet
description
Transcript of Introduction to Java and Applet
![Page 1: Introduction to Java and Applet](https://reader036.fdocuments.net/reader036/viewer/2022062314/56813b7c550346895da491c2/html5/thumbnails/1.jpg)
1
Introduction to Introduction to Java and AppletJava and Applet
![Page 2: Introduction to Java and Applet](https://reader036.fdocuments.net/reader036/viewer/2022062314/56813b7c550346895da491c2/html5/thumbnails/2.jpg)
2
Download Java Compiler (1)Download Java Compiler (1)
![Page 3: Introduction to Java and Applet](https://reader036.fdocuments.net/reader036/viewer/2022062314/56813b7c550346895da491c2/html5/thumbnails/3.jpg)
3
Download Java Compiler (2)Download Java Compiler (2)
![Page 4: Introduction to Java and Applet](https://reader036.fdocuments.net/reader036/viewer/2022062314/56813b7c550346895da491c2/html5/thumbnails/4.jpg)
4
Download Java SDK (3)Download Java SDK (3)
![Page 5: Introduction to Java and Applet](https://reader036.fdocuments.net/reader036/viewer/2022062314/56813b7c550346895da491c2/html5/thumbnails/5.jpg)
5
Installing Standard- Installing Standard- Java 2 SDKJava 2 SDK
![Page 6: Introduction to Java and Applet](https://reader036.fdocuments.net/reader036/viewer/2022062314/56813b7c550346895da491c2/html5/thumbnails/6.jpg)
6
Installation - Installation - check whether you check whether you have installed java and javac have installed java and javac
![Page 7: Introduction to Java and Applet](https://reader036.fdocuments.net/reader036/viewer/2022062314/56813b7c550346895da491c2/html5/thumbnails/7.jpg)
7
Set the path to include the directory Set the path to include the directory
Test it by typing javac in other directory
![Page 8: Introduction to Java and Applet](https://reader036.fdocuments.net/reader036/viewer/2022062314/56813b7c550346895da491c2/html5/thumbnails/8.jpg)
8
JDK componentsJDK components• appletviewer.exe applet viewer• java.exe intepreter• javac.exe compiler• javadoc.exe document generator
• javap.exe deassembler• jdb.exe debugger
![Page 9: Introduction to Java and Applet](https://reader036.fdocuments.net/reader036/viewer/2022062314/56813b7c550346895da491c2/html5/thumbnails/9.jpg)
9
A simple ProA simple Program – javac & javagram – javac & java
![Page 10: Introduction to Java and Applet](https://reader036.fdocuments.net/reader036/viewer/2022062314/56813b7c550346895da491c2/html5/thumbnails/10.jpg)
10
Explanation to the first programExplanation to the first program
![Page 11: Introduction to Java and Applet](https://reader036.fdocuments.net/reader036/viewer/2022062314/56813b7c550346895da491c2/html5/thumbnails/11.jpg)
11
Explanation to the first programExplanation to the first program• Class: First is the name of class. It will
generate a First.class after compilation (javac)
• Public: is an access specifier that allows the programmer to control
• Main(): must be declared as public so that it can be accessed.
• String args[]: argv[0] is the first argument• System.out.println: Display the contents
followed by a line feed
![Page 12: Introduction to Java and Applet](https://reader036.fdocuments.net/reader036/viewer/2022062314/56813b7c550346895da491c2/html5/thumbnails/12.jpg)
12
Javadoc - Javadoc - Document GeneratorDocument Generator
![Page 13: Introduction to Java and Applet](https://reader036.fdocuments.net/reader036/viewer/2022062314/56813b7c550346895da491c2/html5/thumbnails/13.jpg)
13
Javadoc – some exampleJavadoc – some example
![Page 14: Introduction to Java and Applet](https://reader036.fdocuments.net/reader036/viewer/2022062314/56813b7c550346895da491c2/html5/thumbnails/14.jpg)
14
Javadoc.exeJavadoc.exe
• Javadoc is a tool shipped with JDK that generates HTML documentation from the comments in the class source files.
• With the aid of Javadoc we can simplify documentation of our code and make it a regular habit.
![Page 15: Introduction to Java and Applet](https://reader036.fdocuments.net/reader036/viewer/2022062314/56813b7c550346895da491c2/html5/thumbnails/15.jpg)
15
Javap – decompilerJavap – decompiler
![Page 16: Introduction to Java and Applet](https://reader036.fdocuments.net/reader036/viewer/2022062314/56813b7c550346895da491c2/html5/thumbnails/16.jpg)
16
Javap - explanationJavap - explanation• The javap
command disassembles a class file.
• Its output depends on the options used. If no options are used, javap prints out the package.
![Page 17: Introduction to Java and Applet](https://reader036.fdocuments.net/reader036/viewer/2022062314/56813b7c550346895da491c2/html5/thumbnails/17.jpg)
17
Jdb – DebuggerJdb – Debugger
![Page 18: Introduction to Java and Applet](https://reader036.fdocuments.net/reader036/viewer/2022062314/56813b7c550346895da491c2/html5/thumbnails/18.jpg)
18
Jdb - explanationJdb - explanation• The Java Debugger, jdb, is a simple
command-line debugger for Java classes.
• It provides inspection and debugging of a local or remote Java Virtual Machine.
• Jdb class format
![Page 19: Introduction to Java and Applet](https://reader036.fdocuments.net/reader036/viewer/2022062314/56813b7c550346895da491c2/html5/thumbnails/19.jpg)
19
Jdb – helpJdb – help