Search Header Logo

Câu hỏi về vòng lặp trong Java

Authored by Kiều Thị

Fun

1st - 12th Grade

Used 1+ times

Câu hỏi về vòng lặp trong Java
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

11 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Cú pháp nào sau đây là đúng cho vòng lặp for trong Java?

for (initial-action; loop-continuation-condition; action-after-each-iteration) { statement(s); }

for { statement(s); } (initial-action; loop-continuation-condition; action-after-each-iteration)

for (loop-continuation-condition) { statement(s); initial-action; action-after-each-iteration; }

for (action-after-each-iteration; initial-action; loop-continuation-condition) { statement(s); }

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Phần nào trong vòng lặp for được thực thi một lần duy nhất khi vòng lặp bắt đầu chạy?

statement(s)

loop-continuation-condition

initial-action

action-after-each-iteration

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Trong vòng lặp for-each, cú pháp đúng là:

foreach (type var: collection) { statement(s); }

for (collection: type var) { statement(s); }

for (type var: collection) { statement(s); }

for (var in collection) { statement(s); }

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Vòng lặp do-while khác vòng lặp while ở điểm nào?

do-while kiểm tra điều kiện trước khi thực thi lệnh

do-while thực thi các lệnh ít nhất một lần rồi mới kiểm tra điều kiện

do-while không thể sử dụng break và continue

do-while chỉ dùng để lặp qua các phần tử trong mảng

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Câu lệnh nào được sử dụng để kết thúc vòng lặp hiện tại?

exit

stop

break

end

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Câu lệnh nào được sử dụng để bỏ qua phần còn lại trong vòng lặp hiện tại và chuyển đến lần lặp tiếp theo?

next

continue

skip

pass

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

break trong vòng lặp, điều gì sẽ xảy ra?

Chỉ bỏ qua lần lặp hiện tại

Kết thúc toàn bộ vòng lặp và chuyển đến lệnh sau vòng lặp

Bỏ qua lần lặp hiện tại và chuyển đến lần lặp tiếp theo

Kết thúc chương trình

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?