← Quiz: Java Introduction: all 10 questions
Quiz: Java Introduction · Question 5 of 10
What does this print? (code)
What does this print?
public class Main {
public static void main(String[] args) {
System.out.println(5 + 3 + "x");
}
}
- A.53x
- B.8x
- C.x8
- D.Error
Answer & explanation
Correct answer: 8x
5 + 3 = 8 is calculated first (both numbers), then joined with "x".
Can you get the rest right without peeking?
Take the timed Quiz: Java Introduction quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →