Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
To All: Please paste code into a text editor save it as PressAnyKeyDemo.java and compile it; I'm getting '8' error, why? Thank you. import javax.swing.JOptionPane ; { public static void pressAnyKey() { int[] iArray =3D new int [ 1 ] ; try iArray[ 0 ] =3D System.in.read() ; catch( Exception e) // catch an error { public static void main ( String args[]) { System.out.println("Before pressAnykey(). \n") ; pressAnyKey() ; System.out.println("\nAfter pressAnykey().") ; } } // end class
Replies: |
Sponsored Links
|