Accenture Accenture Primer Practice Question
startprogram public interface studentmark{ /*insert code here*/ int mark=100;Answer options
A
which modifiers when inserted in the above code will provide compilation
B
errors?(choose two)
C
final
D
static
E
abstract
F
private
G
public
Correct answer: abstract, private
Explanation
In Java interfaces, fields are implicitly public static final. Adding 'abstract' to a field causes a compile error (abstract is for methods/classes, not fields). Adding 'private' causes a compile error (interface members must be public). Both abstract (index 4) and private (index 5) cause compilation errors.