Professor Kit Romano's Web Site

 



Site Index

About Me

Welcome
Definition of Program
Variable Types
Understanding Memory
Declaring Variables
Simple Commands
Concatenation and Strings
Sleep-Threads-Try Catch
Campus Scenes
Pictures
Java simplified
Application Shell Styles
Reading Data From File
Overview of Applets
Excellent Graphics Applet
Online Reference
Nested if statements
Arrays
Sorting Arrays
Using Strings
Functions
Top 20 Replies 
First program 211
Important Class Example
JAVA in SDK Environment
Understanding OOP
OOP simple example
Recursion example
Example of Inheritance
     and use of JTextArea



*** Web Related **********
Build Student Web Page ?
What is FTP
Download WS ftp95
Download Java Plug In
Applets from jbuilder to sdk
Practice Problems

 

Programming Examples

 

 

                                                

 

Program 1-9

// Input 10 people's names into a one dimensional string array
// and print them in the opposite order of input
// Note Array 10 elements big m the positions are numbered 0 thru 9

import java.io.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class Application1
{
public Application1()
   {
      String nam[]=new String{10];
      int a=0;
      int b=9;
         do
            {
              nam[a]=JOptionPane.showInputDialog("enter name ? ");
              a ++;
            }
                while ( a < 10);|
         do
             {
                JOptionPane.showMessageDialog(null,"name "+b+"  "+nam[b] +"\n");
                b = b - 1;
             }
                 while ( b>0);

     }

public static void main(String args[])
{
Application1 app = new Application1();
System.exit(0);
}

}