Q. What is the difference between a method declaration and a method definition in Java?

  • (A) Declaration specifies method name, return type, and parameters; definition provides the implementation
  • (B) Declaration is used for constructors, and definition is used for regular methods
  • (C) Declaration is optional, and definition is mandatory
  • (D) Declaration and definition are the same in Java
πŸ’¬ Discuss
βœ… Correct Answer: (A) Declaration specifies method name, return type, and parameters; definition provides the implementation

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
108
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Pooja
Publisher
πŸ“ˆ
98%
Success Rate