D286 Java Fundamentals - Set 5 - Part 1
Test your knowledge of technical writing concepts with these practice questions. Each question includes detailed explanations to help you understand the correct answers.
Question 1: What is the output of: System.out.println("Result: " + 3 + 4);
Question 2: What is the output of: System.out.println("Result: " + (3 + 4));
Question 3: How many times does this loop body execute: int i = 0; while (i < 3) { i++; }
Question 4: What is the output of: for (int i = 3; i > 0; i--) System.out.print(i);
Question 5: What does the following evaluate to: int[] a = {1,2,3}; System.out.println(a.length);
Question 6: What is a StringBuilder's advantage in a loop concatenating 1000 Strings?
Question 7: Which statement about the String pool is correct?
Question 8: What is the result of: Integer a = 127, b = 127; System.out.println(a == b);
Question 9: Why should equals() rather than == be used for wrapper comparisons?
Question 10: What is defensive copying?
Question 11: What does the try-with-resources statement require of its resources?
Question 12: What is the correct way to handle an exception you cannot meaningfully recover from at the current level?
Question 13: Why is catching Exception broadly considered poor practice?
Question 14: What is the purpose of logging in an application?
Question 15: What should never be written to application logs?
Question 16: What is the purpose of an access modifier on a class field?
Question 17: Why are public mutable fields generally discouraged?
Question 18: What is the Single Responsibility Principle?
Question 19: What problem does a very large class with many responsibilities create?
Question 20: What is coupling in software design?
Need Guaranteed Results?
Our exam support service guarantees you'll pass your OA on the first attempt. Pay only after you pass!
Get Exam Support