Multiple choice technology programming languages

What is the output of the following code? import java.util.*; public class Example { final Vector v; public Example() { } }

  1. The above code will not compile, Vector v is not initialized.

  2. The above code will compile and throw a Runtime Exception

  3. The above code will compile and not throw any Exception during runtime. V is initialized to null

  4. None of the Above.

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Final instance variables must be initialized exactly once - either at declaration, in an instance initializer block, or in every constructor. The code declares 'final Vector v' but the constructor doesn't initialize it, causing a compile-time error.