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 PracticeGiven the code snippet: int x = 5; int y = 2; double result = x / y; What is the value of result?
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.
A developer writes: String s = "Hello"; s.concat(" World"); System.out.println(s); What is the output?
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".
Given: String str = "Java"; str = str.concat(" SE"); str.replace('a', 'A'); System.out.println(str); What is the output?
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".
Which operator is used to compare two strings for value equality in Java?
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.
What is the result of: System.out.println(10 + 20 + "30");
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 questions1. 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.
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.
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.
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.
Launch a full Primitives, Strings and Operators practice session with instant scoring and detailed explanations.
Start Primitives, Strings and Operators Practice →