// 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);
}
}