View Single Post
  #1 (permalink)  
Old 12-15-2007, 09:55 AM
asahli asahli is offline
Member
 
Join Date: Dec 2007
Posts: 1
asahli is on a distinguished road
Calling method from another class
Hi guys,

i have made two java files as followin:
1st file:
import java.io.*;
public class Reader
{
private static BufferedReader stdin =
new BufferedReader( new InputStreamReader( System.in ) );

public static void main ( String [] args ) throws IOException
{
System.out.println( "input = " + getString());

}


public static String getString() throws IOException
{
String input = stdin.readLine();
return input;
}

}



and the 2nd file is:
public class Test01
{
public static void main(String[] arguments)
{
System.out.println(Reader.getString());
}
}



The problem is that i could'nt call the getString method from Test01 class????
could any one take a look and tell me about it?


thanks
Reply With Quote
Sponsored Links