Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Document preview thumbnail
Vista previa 4 fuera de 65 páginas
Examen

Oracle Java SE Developer Certification: Practice Questions with Answers & Rationales

Document preview thumbnail
Vista previa 4 fuera de 65 páginas

Oracle Java SE Developer Certification: Practice Questions with Answers & Rationales

Vista previa del contenido

Oracle Java SE Developer
Certification: Practice Questions
with Answers & Rationales




Section 1: Java Fundamentals (Questions 1-15)



Q1. Which of the following correctly describes the output of this code?

```java

String s1 = "Java";

String s2 = "Java";

String s3 = new String("Java");

System.out.println(s1 == s2);

System.out.println(s1 == s3);

```

A) true, true

B) true, false

C) false, true

,D) false, false



Answer: B



Rationale: String literals are interned—s1 and s2 reference the same object in the String pool, so
`==` returns true. `new String()` creates a new object in heap memory, so s3 references a
different object, making `==` false. Use `.equals()` for content comparison.




Q2. What is the output of this code?

```java

int x = 5;

int y = 2;

System.out.println(x / y);

System.out.println(x / (double) y);

```

A) 2, 2.5

B) 2.5, 2.5

C) 2, 2.0

D) Compilation error



Answer: A



Rationale: Integer division truncates the remainder, so 5/2 = 2. When one operand is a double,
numeric promotion occurs, yielding 2.5.

,Q3. Which of the following is a valid identifier in Java?

A) 1stPlace

B) _private

C) int

D) my-value



Answer: B



Rationale: Identifiers can start with a letter, underscore (_), or dollar sign ($). `1stPlace` starts
with a digit; `int` is a reserved keyword; `my-value` contains a hyphen (-), which is not allowed.




Q4. What does this code print?

```java

int a = 10;

int b = 20;

boolean result = a++ > 10 && ++b > 20;

System.out.println(a + ", " + b);

```

A) 10, 20

B) 11, 21

C) 11, 20

D) 10, 21

, Answer: C



Rationale: `a++` is post-increment (returns 10, then increments to 11). The first condition (10 >
10) is false, so short-circuit evaluation prevents `++b` from executing. b remains 20.




Q5. Which statement about text blocks in Java is true?

A) Text blocks can only contain ASCII characters

B) Text blocks preserve all whitespace by default

C) Text blocks are delimited by `"""` and can span multiple lines

D) Text blocks cannot contain escape sequences



Answer: C



Rationale: Text blocks (`""" ... """`) were introduced for multi-line strings. They preserve
indentation relative to the closing delimiter and can contain escape sequences. They support all
Unicode characters.




Q6. What is the output?

```java

System.out.println(10 + 20 + "30");

System.out.println("10" + 20 + 30);

```

Información del documento

Subido en
15 de julio de 2026
Número de páginas
65
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$25.99

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
BestwriterGuru
4.8
(721)
Vendido
222
Seguidores
32
Artículos
5055
Última venta
1 día hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes