Select the first letter of the word from the list above to jump to appropriate section of the glossary. If the term you are looking for starts with a digit or symbol, choose the '#' link.
| + | addition |
| - | subtraction |
| * | multiplication |
| / | division |
| % | modulus |
| x += y | x = x + y |
| x -= y | x = x - y |
| x *= y | x = x * y |
| x /= y | x = x / y |
| x++ | x = x + 1 |
| ++x | pre-increment x (x+1) |
Hit the "Return to previous page" or "back" button on your browser
Command line parameters are given when the program is run.
For example if a java program named addem is run with the following line
java addem 34 22 87 9
The program addem will start and the numbers 34, 22, 87 and 9 will be available to the program as command line parameters. If we write the necessary code , the parameters are parsed (looked at one at a time) from left to right and made available for use within the program.
We could make the helloworld applet a bit more friendly using parameters. If we rewrite the applet to accept a parameter and call the applet from within our HTML code with a name for that parameter it could be changed from simply printing "Hello World" to printing "Hello Joe" or any name we want. (Click here to see the code)
These parameters can be used in both Java applications and applets. They allow us to adapt programs to the current situation.
Hit the "Return to previous page" or "back" button on your browser
Usually it is easier to use Notepad or Wordpad in Windows to copy the source code. While the browser is displaying the source code, highlight the code and then click edit and copy (or hit Ctrl-c on the keyboard). Switch to your editor and paste the code into your document.
If you insist you can still do it the hard way and type the lines in yourself.
Once you have entered the code:
Save the source code under the name suggested in the lesson with the .java extension.
Exit the text editor and return to a command prompt.
Type "javac ******.java" at the command prompt.
If there are any errors, return to the editor and ensure the source code is exactly the same as what you see in the lesson. Remember that Java is case sensitive. Check your upper case letters carefully.
If there are no errors the compiler will work for a few seconds and then save a file called ******.class in the same directory.To run the .class file type "java ******" at the command prompt.
(where ****** is the name of the .class file.)
DO NOT type java ******.class. It will not execute if you do.
Hit the "Return to previous page" or "back" button on your browser
| Java Comparison Operators | Java Logical Operators | ||||||||||||||||||||||||
|
|
Hit the "Return to previous page" or "back" button on your browser
Once your applet has been compiled, it must run in a graphic window that is large enough to accommodate the pixels in the applet. The following HTML code will serve as a template to run an applet in your browser.
The defined applet window must be large enough to hold the applet or it will be cropped.
The name of the file called within the HTML code must match the name of the class file exactly, including the case of the letters.
The compiled class file must be in the same directory as the HTML code that is calling it (or the precise path must be specified in the HTML code.)
<html> <p
align="left"><font size="6"> |
|
This generic HTML page can be used to display all of your applets (adjust the size of the pixel window so that your applet is not cropped).
Hit the "Return to previous page" or "back" button on your browser
An Overview of HTML Elements: HTML tags are used to mark the elements of a file for your browser. The left and right angle brackets denote tag names. For example <head> marks the heading and </head> marks the end of the heading. There are two types of HTML tags:
Empty (or open) tags:
represent formatting constructs (i.e. line breaks, horizontal rules)Container tags:
define a section of text and specify the formatting for it
occur in pairs. (i.e. <head>Heading goes here.</head>
HTML Elements for Head Sections in HTML Documents
| Element | Element Type | Description |
| BASE | empty | Base context document |
| HEAD | container | Document head |
| ISINDEX | empty | Document is a searchable index |
| LINK | empty | Link from this document |
| META | container | Generic meta-information |
| NEXTID | empty | Next ID to use for link name |
| TITLE | container | Title of document |
HTML Elements for Body Sections in HTML Documents
| Element | Element Type | Description |
| A | container | Anchor:source and/or destination of a link |
| ADDRESS | container | Address, signature, or byline for a document |
| B | container | Bold text |
| BLOCKQUOTE | container | Quoted passage |
| BODY | container | Document body |
| BR | empty | Line break |
| CITE | container | Name or title of cited work |
| CODE | container | Source code phrase |
| DD | empty | Definition of term |
| DIR | container | Directory list |
| DL | container | Definition list, or glossary |
| DT | empty | Term in definition list |
| EM | container | Emphasized phrase |
| H1 | container | Heading, level 1 |
| H2 | container | Heading, level 2 |
| H3 | container | Heading, level 3 |
| H4 | container | Heading, level 4 |
| H5 | container | Heading, level 5 |
| H6 | container | Heading, level 6 |
| HR | empty | Horizontal rule |
| I | container | Italic text |
| IMG | empty | Image; icon, glyph, or illustration |
| KBD | container | Keyboard phrase, such as user input |
| LI | empty | List Item |
| LISTING | container | Computer listing |
| MENU | container | Menu list |
| OL | container | Ordered or numbered list |
| P | empty | Paragraph |
| PRE | container | Preformatted text |
| SAMP | container | Sample text or characters |
| SELECT | empty | Selection of option(s) |
| STRONG | container | Strong emphasis |
| TT | container | Typewriter text |
| UL | container | Unordered list |
| VAR | container | Variable phrase or substitutable |
| XMP | container | Example Sections |
Click on the "Return to previous page" or "back" button on your browser
Hit the "Return to previous page" or "back" button on your browser
Hit the "Return to previous page" or "back" button on your browser
| Type | Size | Range |
|---|---|---|
| byte | 8 bits | -128 to 127 |
| short | 16 bits | -32,768 to 32,767 |
| int | 32 bits | -2,147,483,648 to 2,147,483,647 |
| long | 64 bits | -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 |
| float | 32 bits | IEEE 754 Standard floating point number |
| double | 64 bits | Double Precision IEEE 754 Standard floating point number |
| char | 16 bits | Unicode Character set |
| boolean | 1 bit | true or false |
Hit the "Return to previous page" or "back" button on your browser