posted 17 years ago
import java.util.*;
public class AllFinals
{
final Vector v;
public AllFinals()
{
}
}
The above code will
1.Not compile. Vector v is not initialized.
2.Will compile and throw a RuntimeException
3.Will compile and not throw any Exception during runtime. V is initalized to null.
Answer is 1.
My question is v should get initialized to null (default value for an object) and if that is the case answer should be 3.
can anybody explain?