Java chương 1

Java chương 1

1st - 5th Grade

10 Qs

quiz-placeholder

Similar activities

Area Bajo la Curva I

Area Bajo la Curva I

5th Grade

8 Qs

Tema 7: Artificios y operaciones especiales

Tema 7: Artificios y operaciones especiales

1st Grade

8 Qs

Tema 1: Conceptos Básicos de Algoritmia

Tema 1: Conceptos Básicos de Algoritmia

1st Grade

8 Qs

For циклі

For циклі

1st Grade

10 Qs

Phép cộng có nhớ trong phạm vi 1000

Phép cộng có nhớ trong phạm vi 1000

2nd Grade

10 Qs

Hoeken berekenen A3KD/A3KH

Hoeken berekenen A3KD/A3KH

KG - 12th Grade

10 Qs

Comparing Lengths  - 2.MD.A.4

Comparing Lengths - 2.MD.A.4

1st - 2nd Grade

10 Qs

what does this integral calculate?

what does this integral calculate?

2nd - 12th Grade

10 Qs

Java chương 1

Java chương 1

Assessment

Quiz

Mathematics

1st - 5th Grade

Medium

Created by

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?