import java.util.Scanner;
import java.awt.Container;
importjavax.swing.*;
public class AM {
public static void main(String[] args)
{
String s0 = JOptionPane.showInputDialog( "no. of Students" );
int array [];
array = new int[s0];
Scanner s = new Scanner ( System.in);
String s1 = JOptionPane.showInputDialog( "Enter the Name of Student" );
String s2 = JOptionPane.showInputDialog("Enter the Exam Marks" );
String output = "Name of the Student\tExam Marks\n";
for ( int counter = 0; counter < array.length; counter++ )
output += counter + "\t" + array[ counter ] + "\n";
JTextArea outputArea = new JTextArea();
outputArea.setText( output);
JOptionPane.showMessageDialog( null, outputArea,
"Analysis of Exam Marks",
JOptionPane.INFORMATION_MESSAGE );
}
}
Why the array = new int [ ] <----can not put s0 into here
and how to make the array be the no. of the student?
And that WHEN I use array = new int [5];
the result :
no.__Marks
1_____0
2_____0
3_____0
4_____0
5_____0
How to make this "0" be the Exam Marks?


