NoSuchMethodError Exception
I keep getting a NoSuchMethodError Exception for the code shown below.
import java.util.*;
import java.lang.*;
import java.io.*;
public class test{
private String readit()
{
// Set the default return value - a blank string
String input = "";
// Create an input stream reader to read from Standard Input (Keyboard)
InputStreamReader isr = new InputStreamReader( System.in );
// Create a buffered reader around the stream reader
// this allows you to read line at a time instead of char by char
BufferedReader br = new BufferedReader( isr );
try
{
input = br.readLine();
}
catch (IOException ex)
{
System.out.println( "Error reading keyboard input." );
}
return input;
}
public void main(String args[]){
try{
String out = "Java is the best language in the world";
readit();
int array[] = new int[5];
for(int i = 0; i < 5; i++){
array = i;
System.out.println(array[i + 1]);
}
array[1] = -9;
}
catch( ArrayIndexOutOfBoundsException e){
System.out.println("Error ");
}
}
}
I don't know why this is but is something to do with calling the readit() method in main, Can anyone tell me how I could get around this or why this is happenning.

