
Java chương 1

Quiz
•
Mathematics
•
1st - 5th Grade
•
Medium
Phamthihuong Dtth
Used 2+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Câu lệnh xác định độ dài mảng buses là:
int buses[] = new int[5];
buses.length
buses.length()
buses.size
buses.size()
2.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Cho biết kết quả:
String[] nums = new String[] { "1", "9", "10" };
Arrays.sort(nums);
System.out.println(Arrays.toString(nums));
[1, 9, 10]
[1, 10, 9]
[10, 1, 9]
3.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Cho biết kết quả:
String[] os = new String[] { "Mac", "Linux", "Windows" };
Arrays.sort(os);
System.out.println(Arrays.binarySearch(os, "Mac"));
0
1
2
4.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Cho biết kết quả:
public class Test{
public static void main(String[] args){
int[] a = new int[0];
System.out.print(a.length);
}
}
Sai a.length
lỗi vì size mảng không thể = 0
0
5.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Cho biết kết quả:
public class Test{
public static void main(String[] args){
int[] x = new int[3];
System.out.println("x[0] is " + x[0]);
}
}
Lỗi vì mảng chưa khởi tạo
x[0] is 0
Lỗi không có giá trị x[0]
6.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Cho kết quả: public class Test{
public static void main(String args[]){
double[] myList = {1, 5, 5, 5, 5, 1};
double max = myList[0];
int indexOfMax = 0;
for(int i = 1; i < myList.length; i++){
if(myList[i] > max){
max = myList[i];
indexOfMax = i;
}
}
System.out.println(indexOfMax);
}
}
0
2
1
7.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Cho biết kết quả:
String s1 = "Java";
String s2 = "Java";
StringBuilder sb1 = new StringBuilder();
sb1.append("Ja").append("va");
System.out.println(s1 == s2);
System.out.println(s1.equals(s2));
System.out.println(sb1.toString() == s1);
System.out.println(sb1.toString().equals(s1));
in ra 1 lần true
in ra 2 lần true
in ra 3 lần true
Create a free account and access millions of resources
Similar Resources on Wayground
13 questions
Язык Python

Quiz
•
5th Grade
10 questions
Kiểu tệp trong Python

Quiz
•
1st Grade
13 questions
INTEGRALES DEFINIDAS 3B

Quiz
•
3rd Grade
15 questions
Latihan soal Keliling dan luas bangun datar

Quiz
•
4th Grade
7 questions
Decimal Division

Quiz
•
5th Grade
11 questions
Caligrafía | CM7

Quiz
•
1st - 10th Grade
8 questions
Robotics Quiz

Quiz
•
1st - 12th Grade
14 questions
Bài kiểm tra

Quiz
•
1st Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Mathematics
25 questions
Multiplication Facts

Quiz
•
5th Grade
20 questions
Finding Volume of Rectangular Prisms

Quiz
•
5th Grade
20 questions
Place Value

Quiz
•
4th Grade
10 questions
Place Value

Quiz
•
3rd Grade
20 questions
place value

Quiz
•
4th Grade
20 questions
Adding and Subtracting Decimals

Quiz
•
5th Grade
20 questions
Place Value and Rounding

Quiz
•
4th Grade
16 questions
Mean, Median, Mode, and Range

Quiz
•
5th Grade