What is the output of the following code? int Integer = 24;
What is the output of the following code?
int Integer = 24;
char String = 'I';
System.out.print(Integer);
System.out.print(String);
Show answerHide answer
Correct answer: (D) 24I
Explanation
Integer and String are class names, not keywords, so they can be used as variable names. The code prints 24 and then I on the same line: 24I.