Home / Questions / What happens if a method doesn’t return a value?
Explanatory Question

What happens if a method doesn’t return a value?

👁 3 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

    • If return type is void → OK

    • Otherwise → compile-time error