Courseiva
Primitives, Strings and OperatorshardMultiple SelectObjective-mapped

1Z0-811 Primitives, Strings and Operators Practice Question

Which three of the following statements about primitive type conversion are true?

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

Implicit widening conversion is allowed from int to long.

The correct answers are B, D, and E. - B is correct: Implicit widening conversion from int to long is allowed because long has a larger range (64-bit vs 32-bit). - D is correct: A char can be assigned to an int without a cast because char is 16-bit unsigned and int is 32-bit, so the value fits without loss. - E is correct: Narrowing conversion from double to int requires an explicit cast because double has a larger range and fractional part cannot be automatically discarded. - A is false: A float cannot be implicitly converted to long because float is 32-bit floating-point; conversion would lose precision and requires an explicit cast. - C is false: A boolean cannot be converted to any numeric type, even with casting; boolean and numeric types are incompatible.

Answer analysis

Option-by-option breakdown

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

  • A float can be implicitly converted to long.

    Why it's wrong here

    Requires explicit cast due to possible precision loss.

  • Implicit widening conversion is allowed from int to long.

    Why this is correct

    int to long is a widening primitive conversion.

  • A boolean can be converted to int using casting.

    Why it's wrong here

    boolean is not compatible with numeric types.

  • A char can be assigned to an int without cast because char is unsigned 16-bit and int is 32-bit.

    Why this is correct

    A `char` can be assigned to an `int` without an explicit cast because this constitutes a widening primitive conversion. `char` is a 16-bit unsigned type, representing values from 0 to 65,535. `int` is a 32-bit signed type, capable of holding a much larger range of values, including all possible `char` values. This automatic conversion satisfies the requirement for safe primitive type conversion, as no data loss occurs.

  • Narrowing conversion from double to int requires an explicit cast.

    Why this is correct

    Narrowing always requires explicit cast.

About these practice questions

Courseiva writes every 1Z0-811 question from scratch — 481 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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.