What will be the output of the following Java program if input given is "Hello stop World"?
class Input_Output
{
public static void main(String args[]) throws IOException
{
string str;
BufferedReader obj = new BufferedReader(new InputStreamReader(System.in));
do
{
str = (char) obj.readLine();
System.out.print(str);
} while(!str.equals("strong"));
}
}
class Input_Output
{
public static void main(String args[]) throws IOException
{
string str;
BufferedReader obj = new BufferedReader(new InputStreamReader(System.in));
do
{
str = (char) obj.readLine();
System.out.print(str);
} while(!str.equals("strong"));
}
}
A. Hello
B. Hello stop
C. World
D. Hello stop World
Answer: Option D
Join The Discussion