Що виведе наступна програма?
class ArrayTest {
public static void main(String[] args) {
float[] f1, f2;
f1 = new float[10];
f2 = f1;
System.out.println("f2[0] = " + f2[0]);
}
}
Java array
Quiz
•
Computers
•
11th Grade - University
•
Hard
Сергій Денисенко
Used 1+ times
FREE Resource
6 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Що виведе наступна програма?
class ArrayTest {
public static void main(String[] args) {
float[] f1, f2;
f1 = new float[10];
f2 = f1;
System.out.println("f2[0] = " + f2[0]);
}
}
Помилка компіляції в рядку f2 = f1;
Виведе у консоль f2[0] = null
Виведе у консоль f2[0] = 0.0
2.
MULTIPLE SELECT QUESTION
2 mins • 1 pt
Виберіть правильні варіанти створення масиву.
int array[] = {5, 7, 3};
int[5] array = new int;
int[] array = new int[4];
int[] array = {5; 7; 3};
3.
MULTIPLE SELECT QUESTION
1 min • 1 pt
Які варіанти спричинять помилку компілятора?
float f2[] = new float[];
float[]f1 = new float[3];
float f3[] = new float[3];
float[] f = new float(3);
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Що спричиняє помилку компілятора?
double array[] = {3, 5, 8};
boolean results[] = new boolean[]{true, false, true};
String cats[] = {"Fluffy", "Spot", "Zeus"};
int [ ][ ] scores = {2,7,6}, {9,3,45};
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Існує наступний код:
int[] a = new int[15];
Які твердження вірні?
a[0] рівне null
a[14] не визначено
a[14] дорівнює 0
a.length дорівнює 15
6.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Яким є результат виконання наступного коду?
public class MyArrays {
public static void main(String[] args) {
byte array[][] = {{1, 2, 3, 4}, {1, 2, 3}};
System.out.println(array[1].length + " " + array.length);
}
}
3 7
2 7
2 4
помилка компіляції
3 2
10 questions
NoeliaHidalgoMartin_curso
Quiz
•
University
10 questions
Quiz 8: Arrays&Vector
Quiz
•
University
10 questions
Quiz 15 - Array Basics
Quiz
•
11th Grade
10 questions
Quiz 16 - Arrays and Loops
Quiz
•
11th Grade
11 questions
Array
Quiz
•
University
9 questions
Recursivitate
Quiz
•
11th Grade
10 questions
Java Static
Quiz
•
University
10 questions
Advanced Java Study Guide
Quiz
•
11th - 12th Grade
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
20 questions
Taxes
Quiz
•
9th - 12th Grade
17 questions
Parts of Speech
Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression
Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing
Quiz
•
9th - 12th Grade
10 questions
Identifying equations
Quiz
•
KG - University