abstract keyword is used
-
When a class is not to be instantiated,
-
declare a method without providing the implementation
-
cannot use a field declared abstract
-
none
Reveal answer
Fill a bubble to check yourself
A,B
Correct answer
Explanation
The abstract keyword in Java serves two main purposes: preventing class instantiation and declaring methods without implementation. Option A is correct because abstract classes cannot be instantiated directly - they must be extended by concrete subclasses. Option B is correct because abstract methods declare the method signature without providing a body, leaving the implementation to concrete subclasses. Options C and D are incorrect - abstract can be used with fields in certain contexts (though not abstract fields themselves), and abstract is a valid part of Java.