
Java-ArrayMethod

Quiz
•
Fun, Professional Development
•
1st - 5th Grade
•
Medium
Kiều Thị
Used 33+ times
FREE Resource
8 questions
Show all answers
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();
8.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Cho biết kết quả của đoạn mã sau?
static void swap(int i,int j){
int temp=i;
i=j;
j=temp;
}
public static void main(String[] args){
int i=1;
int j=2;
swap(i,j);
System.out.println( i + " j = " + j);
}
1, 2
2, 1
1, 1
2, 2
Similar Resources on Wayground
12 questions
Java'da Giriş/Çıkış işlemleri ve Stringler Soruları

Quiz
•
1st - 3rd Grade
11 questions
Python. Типи даних (int, float)

Quiz
•
KG - 3rd Grade
10 questions
Tết Dương lịch Quiz

Quiz
•
5th Grade
12 questions
Bé Mã sinh nhật vui vẻ ^^

Quiz
•
1st - 12th Grade
10 questions
Data Structure

Quiz
•
4th Grade
10 questions
Lớp học mật ngữ

Quiz
•
2nd Grade
10 questions
Countries and Nationalities

Quiz
•
3rd - 12th Grade
7 questions
Викторина по теме “Двумерные массивы”

Quiz
•
3rd Grade
Popular Resources on Wayground
10 questions
SR&R 2025-2026 Practice Quiz

Quiz
•
6th - 8th Grade
30 questions
Review of Grade Level Rules WJH

Quiz
•
6th - 8th Grade
6 questions
PRIDE in the Hallways and Bathrooms

Lesson
•
12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
15 questions
Subtracting Integers

Quiz
•
7th Grade
Discover more resources for Fun
10 questions
Fact Check Ice Breaker: Two truths and a lie

Quiz
•
5th - 12th Grade
12 questions
Disney Trivia

Lesson
•
5th - 12th Grade
17 questions
Disney Characters

Quiz
•
3rd - 6th Grade
10 questions
Ice Breaker Trivia: Food from Around the World

Quiz
•
3rd - 12th Grade
20 questions
Fun Trivia

Quiz
•
2nd - 4th Grade
20 questions
Cartoon Characters!

Quiz
•
KG - 5th Grade
20 questions
Back to School

Quiz
•
4th - 5th Grade
40 questions
Trivia for kids

Quiz
•
3rd Grade