• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 4 fuera de 52 páginas
Examen

Wgu D286 — Java Fundamentals | Comprehensive Objective Assessment | Study Guide | Latest Update 2026/2027 | Practice Questions And Answers | Exam Review

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

This comprehensive examination is designed for students enrolled in WGU D286: Java Fundamentals. It rigorously assesses the foundational knowledge and coding skills required for success in Java programming, aligned with the Oracle Certified Associate, Java SE 8 Programmer I (1Z0-808) certification objectives. The examination covers the full scope of the course's competency domains: Java Basics and Data Types, Operators and Control Flow, Arrays and Collections, Methods and Encapsulation, Object-Oriented Programming (Inheritance and Polymorphism), Exception Handling, and Working with Selected Classes (String, StringBuilder, ArrayList, etc.). Questions emphasize the application of core Java concepts to real-world coding scenarios, including code-reading, debugging, and writing small programs. Passing this examination demonstrates mastery of essential Java programming principles and readiness for professional certification.

Vista previa del contenido

WGU D286 |1




WGU D286 — Java Fundamentals | Comprehensive
Objective Assessment | Study Guide | Latest Update
2026/2027 | Practice Questions and Answers | Exam
Review



Table of Contents
1. Java Basics, Syntax, and Structure
2. Primitive Data Types and Literals
3. Operators and Expressions
4. Control Flow: if/else, switch, and Loops
5. Arrays: One-Dimensional and Multi-Dimensional
6. Methods, Parameters, and Overloading
7. Encapsulation and Access Modifiers
8. Object-Oriented Programming: Classes and Objects
9. Inheritance and Polymorphism
10. Abstract Classes and Interfaces
11. Exception Handling
12. Working with Strings and StringBuilder
13. Collections: ArrayList and Wrapper Classes
14. Static and Final Keywords
15. Code Reading and Output Prediction

, WGU D286 |2

Question 1: Which of the following is the correct entry point for a Java application?
A. public void main(String[] args)
B. public static void main(String[] args)
C. public static int main(String[] args)
D. public static void main()

Correct Answer: B. public static void main(String[] args)
The main method must be declared as public, static, void, and accept a String array
parameter. This exact signature allows the Java Virtual Machine (JVM) to invoke the method
as the starting point of the application. Any other signature will result in a runtime error
stating that the main method is not found.

Question 2: What is the correct way to declare a variable that stores the number of students in
a class?
A. numStudents = 30;
B. int numStudents = 30;
C. integer numStudents = 30;
D. numStudents int = 30;

Correct Answer: B. int numStudents = 30;
In Java, variables must be declared with a data type before use. The int keyword declares an
integer variable. Java is statically typed, meaning every variable must have a declared type.
The syntax is type variableName = value;.

Question 3: What is the output of System.out.println();?
A. 3.3333333333333335
B. 3.0
C. 3
D. 4

Correct Answer: C. 3
When both operands of the division operator are integers, Java performs integer division,
which truncates the decimal portion. The result is 3, not 3.333. To get a decimal result, at
least one operand must be a floating-point type.

Question 4: Which data type would be most appropriate for storing a monetary value with
decimal precision?

, WGU D286 |3

A. int
B. double
C. boolean
D. char

Correct Answer: B. double
The double type is a floating-point type that can store decimal values, making it suitable for
monetary calculations (though BigDecimal is preferred for exact precision). int stores whole
numbers, boolean stores true/false, and char stores a single character.

Question 5: What is the correct way to declare a constant in Java?
A. const int MAX = 100;
B. final int MAX = 100;
C. static int MAX = 100;
D. immutable int MAX = 100;

Correct Answer: B. final int MAX = 100;
The final keyword makes a variable a constant, meaning its value cannot be changed after
initialization. Java does not have a const keyword. By convention, constants are named in
uppercase with underscores. The static keyword is not required for a constant but is often
used for class-level constants.

Question 6: What is the output of System.out.println(5 + 3 * 2);?
A. 16
B. 11
C. 13
D. 10

Correct Answer: B. 11
Java follows the standard order of operations (PEMDAS). Multiplication is performed before
addition. So 3 * 2 = 6, then 5 + 6 = 11. Using parentheses can override the order, e.g., (5 + 3)
* 2 = 16.

Question 7: Which of the following is NOT a primitive data type in Java?
A. int
B. boolean

, WGU D286 |4

C. String
D. double

Correct Answer: C. String
String is a class in Java, not a primitive type. The eight primitive types
are byte, short, int, long, float, double, char, and boolean. String is a reference type that
represents a sequence of characters.

Question 8: What is the range of values that can be stored in a byte variable?
A. -128 to 127
B. -32768 to 32767
C. 0 to 255
D. -2147483648 to 2147483647

Correct Answer: A. -128 to 127
A byte is an 8-bit signed integer, giving it a range of -128 to 127. The short type is 16-bit (-
32768 to 32767), int is 32-bit, and long is 64-bit. Choosing the correct type depends on the
range of values needed.

Question 9: What is the output of System.out.println("Hello" + 5 + 3);?
A. Hello53
B. Hello8
C. Hello 5 3
D. Error

Correct Answer: A. Hello53
When the + operator is used with a string and a number, Java performs string concatenation.
The expression is evaluated left to right: "Hello" + 5 becomes "Hello5", then "Hello5" +
3 becomes "Hello53". To get Hello8, you would need "Hello" + (5 + 3).

Question 10: What is the output of System.out.println("Hello" + (5 + 3));?
A. Hello53
B. Hello8
C. Hello 5 3
D. Error

Correct Answer: B. Hello8
Parentheses change the order of evaluation. The expression (5 + 3) is evaluated first to 8,

Información del documento

Subido en
12 de septiembre de 2026
Número de páginas
52
Escrito en
2026/2027
Tipo
Examen
Contiene
Preguntas y respuestas
$18.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
TopTier
4.0
(1)
Vendido
1
Seguidores
0
Artículos
640
Última venta
3 meses 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