External Links Bar:

ClamWin Free Anti-Virus Guarani Soccer Team, Paraguay

Mr. Page's Classroom



Left Hand Side Navigation and Information Bar:

Oregon Standards
Mr. Page's Other Web Sites



Right hand side information bar:

Last Updates
3-Jan-10
Web Site re-Design finished.

Mr. Page's Professional Profile Page

Professional Development

AASSA - Asuncion

Integration of computers in writing process.

AASSA - Rio

Use of digital video and the writing process.

 Use OpenOffice.org


Let's Sk8!
Tip of the Day
Don't stare at the PC screen for hours at a time!
Java

Hello World Program:

class Hello { public static void main ( String[] args ) { System.out.println("Hello World!"); } }

Variables

class Hello { public static void main ( String[] args ) { String junk = "test"; long payAmount = 123; } }

Arithmetic Operators

Output

class Hello { public static void main ( String[] args ) { String junk = "test"; long payAmount = 123; System.out.println(inData + payAmount ); } }

Input

import java.io.*; class Echo { public static void main (String[] args) throws IOException { InputStreamReader inStream = new InputStreamReader( System.in ) ; BufferedReader stdin = new BufferedReader( inStream ); String inData; String inData2; System.out.println("Enter the data:"); inData = stdin.readLine(); System.out.println("You entered:" + inData ); System.out.println("Enter the data2:"); inData2 = stdin.readLine(); System.out.println("You entered:" + inData2 ); } }

If

import java.io.*; class NumberTester { public static void main (String[] args) throws IOException { BufferedReader stdin = new BufferedReader ( new InputStreamReader( System.in ) ); String inData; int num; System.out.println("Enter an integer:"); inData = stdin.readLine(); num = Integer.parseInt( inData ); // convert inData to int if ( num < 0 ) // is num less than zero? System.out.println("The number " + num + " is negative"); // true-branch else System.out.println("The number " + num + " is positive"); // false-branch System.out.println("Good-bye for now"); // always executed } }

While class LoopExample { public static void main (String[] args ) { int count = 1; // start count out at one while ( count <= 3 ) // loop while count is <= 3 { System.out.println( "count is:" + count ); count = count + 1; // add one to count } System.out.println( "Done with the loop" ); } }

Arrays

class arrayEg1 { public static void main ( String[] args ) { int[] stuff = new int[5]; stuff[0] = 23; stuff[1] = 38; stuff[2] = 7*2; System.out.println("stuff[0] has " + stuff[0] ); System.out.println("stuff[1] has " + stuff[1] ); System.out.println("stuff[2] has " + stuff[2] ); System.out.println("stuff[3] has " + stuff[3] ); System.out.println("stuff[4] has " + stuff[4] ); } }

Reference:

Java Programming