English

A method can use a single return statement. - Computer Applications

Advertisements
Advertisements

Question

A method can use a single return statement. 

Options

  • True

  • False

MCQ
True or False

Solution

This statement is True.

Explanation:

  1. In Java, a method can return a value by a single return statement. The return statement terminates the method's execution and returns the provided value (if any) to the caller.
  2. A method that allows multiple return statements is commonly used in conditional logic (such as if-else).
shaalaa.com
  Is there an error in this question or solution?
Chapter 5: User - Defined Methods - EXERCISES [Page 335]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 5 User - Defined Methods
EXERCISES | Q III. 2. | Page 335
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×