Java minus sign

Multiple choice question

What will be the output of the following code part:

 Integer i = 34;
String s = "is my age";
String out = i + '-' + s;
System.out.println(out);

correct

79is my age

wrong

34-is my age

wrong

Error

Feedback:

The '-' is character and like in C has a value (45). Java converts the Integer to int and the char '-' to int and sum their values.

0
Your rating: None
This question is part of the following quizzes