Courseiva
Knowledge + Practice
CertificationsVendorsCareer RoadmapsLabs & ToolsStudy GuidesGlossaryPractice Questions
C
Courseiva

Free IT certification practice questions with explained answers for CCNA, CompTIA, AWS, Azure, Google Cloud, and more.

Certification Practice Questions

CCNA practice questionsSecurity+ SY0-701 practice questionsAWS SAA-C03 practice questionsAZ-104 practice questionsAZ-900 practice questionsCLF-C02 practice questionsA+ Core 1 practice questionsGoogle Cloud ACE practice questionsCySA+ CS0-003 practice questionsNetwork+ N10-009 practice questions
View all certifications →

Product

CertificationsCertification PathsExam TopicsPractice TestsExam Dumps vs Practice TestsStudy HubComparisons

Company

AboutContactEditorial PolicyQuestion Writing PolicyTrust Center

Legal

Privacy PolicyTerms of Service

Courseiva is a free IT certification practice platform offering original exam-style practice questions, detailed explanations, topic-based practice, mock exams, readiness tracking, and study analytics for Cisco, CompTIA, Microsoft, AWS, and other technology certifications.

© 2026 Courseiva. Courseiva is operated by JTNetSolutions Ltd. All rights reserved.

Courseiva is an independent certification practice platform and is not affiliated with, endorsed by, or sponsored by Cisco, Microsoft, AWS, CompTIA, Google, ISC2, ISACA, or any other certification vendor. Vendor names and certification marks are used only to identify the exams learners are preparing for.

HomeCertifications1Z0-811TopicsPrimitives, Strings and Operators
Free · No Signup RequiredOracle · 1Z0-811

1Z0-811 Primitives, Strings and Operators Practice Questions

18+ practice questions focused on Primitives, Strings and Operators — one of the most tested topics on the Oracle Java Foundations 1Z0-811 exam. Each question includes a detailed explanation so you learn why the right answer is correct.

Start Primitives, Strings and Operators Practice

Exam Domains

What is JavaJava Basics and SyntaxPrimitives, Strings and OperatorsControl Flow and LoopsArrays and MethodsObject-Oriented ProgrammingException Handling and Development ToolsAll domains →

Study Tools

Practice TestMock ExamFlashcardsAll Topics

Sample Primitives, Strings and Operators Questions

Practice all 18+ →
1.

Given the code snippet: int x = 5; int y = 2; double result = x / y; What is the value of result?

A.2.0
B.Compilation fails
C.2.5
D.2

Explanation: Option A is correct because in Java, when both operands of the division operator are integers (int), integer division is performed, which truncates the fractional part. Here, x / y evaluates to 5 / 2 = 2 (integer division), and then the int value 2 is implicitly widened to double 2.0 when assigned to the double variable result.

2.

A developer writes: String s = "Hello"; s.concat(" World"); System.out.println(s); What is the output?

A.Compilation fails
B.Hello World
C.Hello
D.Hello World

Explanation: Option C is correct because strings in Java are immutable. The `concat()` method returns a new string but does not modify the original string `s`. Since the return value is not assigned to any variable, the original string `s` remains unchanged, so `System.out.println(s)` prints "Hello".

3.

Given: String str = "Java"; str = str.concat(" SE"); str.replace('a', 'A'); System.out.println(str); What is the output?

A.Java
B.JAVA SE
C.Java SE
D.JAvA SE

Explanation: Option C is correct because the `concat` method returns a new String "Java SE" which is assigned back to `str`. The `replace` method also returns a new String but its result is not assigned to any variable, so the original `str` remains unchanged. The final `println` outputs the current value of `str`, which is "Java SE".

4.

Which operator is used to compare two strings for value equality in Java?

A.compareTo()
B.=
C.==
D.equals()

Explanation: Option D is correct because the equals() method in Java's String class compares the actual character sequences of two strings for value equality. Unlike the == operator, which checks reference equality (whether two references point to the same object in memory), equals() performs a lexicographic comparison of the string contents, returning true if and only if both strings have the same length and the same characters in the same order.

5.

What is the result of: System.out.println(10 + 20 + "30");

A.102030
B.3030
C.30
D.Compilation fails

Explanation: In Java, the '+' operator is left-associative. The expression `10 + 20 + "30"` is evaluated as `(10 + 20) + "30"`, which first performs integer addition to get `30`, then concatenates that integer with the string `"30"`, resulting in the string `"3030"`. The `System.out.println` method then prints the string `3030`.

+13 more Primitives, Strings and Operators questions available

Practice all Primitives, Strings and Operators questions

How to master Primitives, Strings and Operators for 1Z0-811

1. Baseline your knowledge

Start with 10 questions to gauge your current understanding of Primitives, Strings and Operators. This tells you whether you need a concept refresher or just practice.

2. Review every explanation

For each question — right or wrong — read the full explanation. Understanding why an answer is correct is more valuable than knowing the answer itself.

3. Focus on exam traps

Primitives, Strings and Operators questions on the 1Z0-811 frequently use trap wording. Look for subtle differences in answers that test your precision, not just general knowledge.

4. Reach 80% consistently

Do repeated sessions until you score 80%+ three times in a row. Then move to mixed-mode practice to test cross-topic recall under realistic conditions.

Frequently asked questions

How many 1Z0-811 Primitives, Strings and Operators questions are on the real exam?

The exact number varies per candidate. Primitives, Strings and Operators is tested as part of the Oracle Java Foundations 1Z0-811 blueprint. Practicing with targeted Primitives, Strings and Operators questions ensures you can handle any format or difficulty that appears.

Are these 1Z0-811 Primitives, Strings and Operators practice questions free?

Yes. Courseiva provides free 1Z0-811 practice questions across all exam topics and domains. The platform includes topic-based practice, mock exams, missed-question review, bookmarked questions, and readiness tracking — no account required.

Is Primitives, Strings and Operators one of the harder 1Z0-811 topics?

Difficulty is subjective, but Primitives, Strings and Operators is a high-priority exam concept tested in multiple ways — direct recall, scenario analysis, and command-output interpretation. Consistent practice is the best way to build confidence.

Ready to practice?

Launch a full Primitives, Strings and Operators practice session with instant scoring and detailed explanations.

Start Primitives, Strings and Operators Practice →

Topic Info

Topic

Primitives, Strings and Operators

Exam

1Z0-811

Questions available

18+