posted 17 years ago
Given the following set of member declarations, which of the following is true?
int a; // (1)
static int a; // (2)
int f( ) { return a; } // (3)
static int f( ) { return a; } // (4
Select 2 correct options
a Declarations (1) and (3) cannot occur in the same class definition.
b Declarations (2) and (4) cannot occur in the same class definition.
A static method can refer to a static field.
c Declarations (1) and (4) cannot occur in the same class definition.
because f() is static and a is not.
d Declarations (2) and (3) cannot occur in the same class definition.
e Declarations (1) and (2) cannot occur in the same class definition
One correct option is : c
Other correct option : e
WHAT ABOUT option d?