Hi all,
Here in the code below, I have a method which returns an int.
But the call to the method like
p.fliton(); works fine
But I thought it should be assigned to an int like here
int i = p.fliton(); // even this works fine.
Can anyone explain this behaviour ?
public class Test{
public static void main(
String argv[]){
Test p = new Test();
p.fliton();
}
public int fliton(){
try{
DataInputStream din = new DataInputStream(System.in);
din.readChar();
}catch(IOException ioe){
System.out.println("flytwick");
return 99;
}finally{
System.out.println("fliton");
}
return -1;
}
}
Thanks in Advance.
Aruna