If a function contains two return statements successively, the complier will generate warnings. Yes / No?

If a function contains two return statements successively, the complier will generate warnings. Yes / No?

A. Yes

B. No

Hướng dẫn

Chọn B là đáp án đúng

Xem lời giải

Xem lời giải

Vì gặp lệnh return thứ nhất, kết thúc hàm.

Nếu 1 hàm dùng nhiều câu lệnh return liên tiếp nhau, chỉ có câu lệnh return đầu tiên có ý nghĩa, các câu lệnh sau nó ko bao giờ được thực hiện.

 

Thư viện tài liệu12 Tháng bảy, 2023 @ 3:02 chiều

Đánh giá chủ đề này
How to whitelist website on AdBlocker?

How to whitelist website on AdBlocker?

  1. 1 Click on the AdBlock Plus icon on the top right corner of your browser
  2. 2 Click on "Enabled on this site" from the AdBlock Plus option
  3. 3 Refresh the page and start browsing the site