1Z0-811 · topic practice

Primitives, Strings and Operators practice questions

Practise Oracle Java Foundations 1Z0-811 Primitives, Strings and Operators practice questions — original exam-style scenarios with answer choices, explanations, and analysis of common mistakes.

Courseiva uses original exam-style practice questions designed for learning and revision. The goal is to understand the concepts, recognise exam patterns, and improve through explanations — not memorise copied exam dumps.

Reviewed byJohnson Ajibi· MSc IT Security
18 questionsDomain: Primitives, Strings and Operators

What the exam tests

What to know about Primitives, Strings and Operators

Primitives, Strings and Operators questions test whether you can apply the concept in context, not just recognise a definition.

How the topic appears in realistic exam-style scenarios.

Which detail in the question changes the correct answer.

How to eliminate plausible but wrong options.

How to connect the question back to the wider exam objective.

Watch out for

Common Primitives, Strings and Operators exam traps

  • Answering from memory before reading the full scenario.
  • Missing a constraint such as cost, availability, security, scope or command context.
  • Choosing a broad answer when the question asks for the most specific fix.
  • Ignoring why the wrong options are tempting.

Practice set

Primitives, Strings and Operators questions

18 questions · select your answer, then reveal the explanation

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

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

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

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

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

Given: boolean a = false; boolean b = true; boolean c = true; System.out.println(a || b && c); What is the output?

Which of the following is a valid Java identifier?

What is the output of: int i = 1; i = i++; System.out.println(i);

Which primitive type can store a single character?

Given: double d = 5.0; int i = d; What is the result?

What is the default value of a boolean variable in Java?

Which TWO of the following are valid ways to create a String?

Which THREE of the following are valid Java operators?

Which TWO of the following are primitive data types in Java?

Which THREE of the following expressions evaluate to true? (Assume int a=5, b=10)

What is the value of y?

Exhibit

Refer to the exhibit.

public class Test {
    public static void main(String[] args) {
        int x = 10;
        int y = x++ + ++x;
        System.out.println(y);
    }
}

A developer is working on a Java application that processes user input. The application reads a string from the console and needs to compare it with a predefined constant string "ADMIN". The developer writes the following code: if (input == "ADMIN") { grantAccess(); }. During testing, the condition sometimes fails even when the user enters ADMIN. The input string is obtained via Scanner.nextLine(). Which is the most likely cause and best fix?

A banking application uses a method to calculate interest: double calculateInterest(double balance) { return balance * 0.05; }. The method is called with an int argument: int accountBalance = 1000; double interest = calculateInterest(accountBalance); System.out.println(interest); The output is 50.0, but the expected output is 50.0. However, the developer notices that if the method is changed to return int, the output becomes 50.0 as well. Which statement about implicit casting is true?

Free account

Track your progress over time

Create a free account to save your results and see which topics improve across sessions.

Focused Primitives, Strings and Operators sessions

Start a Primitives, Strings and Operators only practice session

Every question in these sessions is drawn from the Primitives, Strings and Operators domain — nothing else.

Related practice questions

Related 1Z0-811 topic practice pages

Move into related areas when this topic feels solid.

Frequently asked questions

What does the 1Z0-811 exam test about Primitives, Strings and Operators?
Primitives, Strings and Operators questions test whether you can apply the concept in context, not just recognise a definition.
How should I use these practice questions?
Select your answer before revealing the explanation. Then read why each option is right or wrong — this active recall approach builds retention far faster than re-reading notes.
Can I practise just Primitives, Strings and Operators questions in a focused session?
Yes — the session launcher on this page draws every question from the Primitives, Strings and Operators domain. Use a 10-question session first to gauge your baseline, then move to 20 or 30 once the weak spots are clear.
Where can I practise other 1Z0-811 topics?
Use the topic links above to move to related areas, or go back to the 1Z0-811 question bank to see all topics.
Are these real exam questions or dumps?
These are original practice questions written to test the same concepts the 1Z0-811 exam covers. They are not copied from any real exam or dump site.