Question discussion

What is the output of the following code?int Integer = 24; char String = 'I'; System.out.print(Integer); System.out.print(String);

3741Medium DSSSB TGT Computer Science 0 replies

What is the output of the following code?

int Integer = 24;
char String = 'I';
System.out.print(Integer);
System.out.print(String);
  • AI
  • BCompiler Error
  • CThrows Exception
  • D24I
Correct answer: D

Explanation

The int value 24 is printed first and then the char ‘I’, so the output is 24I.

Discussion 0

Nobody has replied yet. Start the discussion!