What is the syntax for using abstract method?

What is the syntax for using abstract method?
A. <access-modifier>abstract<return-type>method_name (parameter)
B. abs<return-type>method name (parameter)
C. <access-modifier>abstract return-type method name (parameter)
D. <access-modifier>abstract <returning> method name (parameter)
 
Answer: a
Explanation: The syntax must firstly contain the access modifier. Then the keyword abstract is written to mention clearly to the compiler that it is an abstract method. Then prototype of the function with return type, function name and parameters.
 

Tìm kiếm

Back
Top