Courseiva
Java Basics and SyntaxmediumMultiple ChoiceObjective-mapped

1Z0-811 Java Basics and Syntax Practice Question

What is the result of the following code? String s1 = "Hello"; String s2 = " World"; String s3 = s1 + s2; System.out.println(s3);

⚠ Common exam trap

Oracle often tests whether candidates notice the leading space in s2 (" World") versus assuming no space, leading them to choose Option A ("HelloWorld") instead of the correct output with the space.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Hello World

The + operator performs string concatenation in Java. s1 + s2 combines "Hello" and " World" to produce "Hello World", which is then printed. The space is part of s2, so the output includes it.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • HelloWorld

    Why it's wrong here

    Missing space; the literal includes a space.

  • Hello World

    Why it's wrong here

    Extra space at the end - not present.

  • Compilation error

    Why it's wrong here

    No error; string concatenation is valid.

  • Hello World

    Why this is correct

    Correct: concatenation yields 'Hello World'.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

About these practice questions

One of 481 original 1Z0-811 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This 1Z0-811 practice question is part of Courseiva's free Oracle certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 1Z0-811 exam.