I came across this program and its not behaving in expected way.
public class StringTest
{
public static void main(String[] args)
{
String s = "Hello world";
for(int i = 0 ; i < s.length() ; i++)
{
System.out.write(s.charAt(i));
}
}
}
If we think it should print Hello world but it prints nothing. What is going on? Any ideas? Thanks in advance.
flush().