Kemal Sokolovic wrote:You can create a batch file (under Windows) or a shell script (*nix) that you can use to run your console application. E.g., for Windows:
Save it under a name with .bat extension, and you'll have the desired result - double click on this file will run your application.
Paul Clapham wrote:
The API Documentation wrote:The GridLayout class is a layout manager that lays out a container's components in a rectangular grid. The container is divided into equal-sized rectangles, and one component is placed in each rectangle.
mike statham wrote:Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2
at Grades.main(Grades.java:26)
Is what I get after applying the suggestion todo the the following
int[] numGrade = new int[20];
Tim Moores wrote:Just a guess: Don't println to a Socket. It applies to readLine as well.
Rob Spoor wrote:It is from Java 7 on:
If you're using Java 6 or an even older version you have no choice but to use two distinct catch statements.
However, you shouldn't need to catch NullPointerException at all. You should instead prevent it by adding the necessary checks.