Java Fundamentals & Object-Oriented Programming Flashcards
7 cards from real 1Z0-819 practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Java Fundamentals & Object-Oriented Programming flashcards as text
What is the output of: `System.out.println(10 / 3);`?
Answer: 3
Integer division truncates the decimal part, so 10 / 3 yields 3.
Which keyword prevents a class from being subclassed in Java?
Answer: final
The `final` keyword on a class declaration prevents any other class from extending it.
Given `String s = null; System.out.println(s instanceof String);`, what is printed?
Answer: false
`instanceof` always returns false when the left operand is null, without throwing an exception.
Which access modifier makes a member visible only within its own class?
Answer: private
`private` restricts visibility strictly to the declaring class itself.
What does the `super()` call inside a constructor do?
Answer: Invokes the superclass constructor
`super()` must be the first statement in a constructor and delegates to the matching superclass constructor.
Which of the following is a valid declaration of a two-dimensional int array in Java?
Answer: int[][] arr;
The canonical style places both bracket pairs after the type: `int[][] arr;`.
What is autoboxing in Java?
Answer: Automatic conversion of a primitive to its wrapper type
Autoboxing is the automatic conversion the compiler performs from a primitive (e.g., int) to its corresponding wrapper class (e.g., Integer).