D286 Java Fundamentals - Set 3 - 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: int x = 5; System.out.println(x++);
Question 2: What is the output of: int x = 5; System.out.println(++x);
Question 3: What is the value of result after: int result = 10 + 5 * 2;
Question 4: What does the expression (3 > 2) && (2 > 5) evaluate to?
Question 5: What is the value of s after: String s = "Java"; s.toUpperCase();
Question 6: Which loop prints the numbers 1 through 5?
Question 7: How many times does this loop execute: for (int i = 0; i < 10; i += 2)?
Question 8: What does the expression "5" + 5 produce in Java?
Question 9: What does 5 + 5 + "5" produce?
Question 10: Which statement correctly declares and initializes a two-dimensional array?
Question 11: What is the result of comparing two String objects created with new using ==?
Question 12: What does the String method equalsIgnoreCase() do?
Question 13: What does the trim() method on a String accomplish?
Question 14: What does the split() method return?
Question 15: What does Integer.parseInt("42") return?
Question 16: What does the charAt(0) method return for the String "Hello"?
Question 17: What is the purpose of the indexOf() method on a String?
Question 18: What does the contains() method on a String return?
Question 19: Which loop construct is most appropriate for iterating over an ArrayList when the index is not needed?
Question 20: Which ArrayList method adds an element to the end of the list?
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