🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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");
    }
}
  1. A.53x
  2. B.8x
  3. C.x8
  4. 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 →