|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: ash (ashcrow
phreaker.net)Date: Wed Jun 26 2002 - 13:05:49 CDT
What happened here is that the JavaVM caught an exception while parsing
the code. It won't cause any problems AFAIK but it will keep a program
from working ;-).
Generally speaking you use try {} catch () {} to deal with raised
exceptions in Java so that if an error does happen it is delt with
properly or errors out in such a manor that the user can understand why.
Cheers,
Ash
---- Darkfire Secure Linux -- http://www.gnulinux.netOn Mon, 2002-06-24 at 23:40, KF wrote: > Not sure if this helps .... I was trying to come up with a scenario that > passed user input to a buffer but the compiler kept barking at me so > this is the best I can do. > > [root
qa5 root]# cat test.java > class test > { > public static void main(String args[]) > { > > String[] test = new String[4]; > test[0] = "A"; > test[1] = "A"; > test[2] = "A"; > test[3] = "A"; > test[4] = "A"; > test[5] = "A"; > test[6] = "A"; > } > } > > > [root
rcmqa5 root]# javac test.java > [root
rcmqa5 root]# java test > Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4 > at test.main(test.java:11) > > -KF
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]