
Java-ArrayMethod
Authored by Kiều Thị
Fun, Professional Development
1st - 5th Grade
8 Questions
Used 33+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Câu 1: Cho biết kết quả của đoạn mã sau:
int a1[] = {1,3,4,5};
int a2[][] = {{1,2,3},{4,5,6}};
a1[1] = a2[2][1];
a1[4] = a2[2][2];
for(int i = 0;i<a1.length;i++){
System.out.println(a1[i]);
}
Lỗi biên dịch
Xảy ra lỗi ArrayIndexOutOfBoundsException
1,5,4,5
1,5,4,5,6
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Lệnh nào để lấy ra độ dài của mảng là gì ?
length
size()
length()
size
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Cho biết kết quả của đoạn mã sau?
int[] x = {1, 3, 7, 9};
for(int a : x){
System.out.print(a);
if(a % 2 != 0){
break;
}
}
1, 3, 5, 7
1
3, 5, 7
Không có đáp án đúng
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Cho biết kết quả của đoạn mã sau?
int[] x = {5,6,7,8,9};
for(int a : x){
System.out.print(a) ;
}
5,6,7,8
5,6,7,8,9
a, a, a, a, a
a
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Cho biết kết quả đoạn mã sau:
int index = -1, a[] = {1,2,3,4};
for(int i=0;i<a.length();i++){
if(a[i] == 2){
index = i;
}
}
0
1
Lỗi biên dịch
2
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Cho biết kết quả của đoạn mã sau:
public static int tinhTong(int a[]){
int s = 0;
for (int i = 0;i<a.length;i++){
s+= a[i];
}
return s;
}
public static void main(String[] args) {
int a[] = {1,3,4,5};
System.out.println(tinhTong(a));
}
Lỗi biên dịch
13
12
10
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Khai báo nào sau đây có kiểu trả về là true/false?
public static boolean a();
public static int a();
public static long a1();
public static void a();
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
11 questions
C2 KUP
Quiz
•
KG - University
11 questions
Term 1 Reflection
Quiz
•
KG - Professional Dev...
12 questions
Wózki widłowe - grupa obojętna
Quiz
•
1st - 5th Grade
10 questions
Pengelolaan UP BP 1
Quiz
•
3rd Grade
11 questions
YEW
Quiz
•
1st - 3rd Grade
10 questions
Name that superhero
Quiz
•
1st - 3rd Grade
10 questions
PRE | POST TEST STRATEGIC A52s
Quiz
•
1st - 3rd Grade
10 questions
Mirror, the Hong Kong Boy Band
Quiz
•
1st - 12th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Fun
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
10 questions
Christmas Trivia for Kids
Quiz
•
5th Grade
10 questions
Christmas/Winter
Quiz
•
KG - 2nd Grade
57 questions
Holiday Trivia
Quiz
•
5th Grade
12 questions
Holiday Fun
Quiz
•
3rd Grade
20 questions
Kids Movie Trivia
Quiz
•
3rd Grade
23 questions
How the Grinch Stole Christmas
Lesson
•
5th Grade