Multiple choice technology programming languages

abstract keyword is used

  1. When a class is not to be instantiated,

  2. declare a method without providing the implementation

  3. cannot use a field declared abstract

  4. 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.