
Data Structures & Algorithms Quiz
Flashcard
•
Other
•
2nd Grade
•
Practice Problem
•
Hard
John Alvin Omiles
FREE Resource
Student preview

51 questions
Show all answers
1.
FLASHCARD QUESTION
Front
What will the output be for the code snippet: int[] arr1 = {1, 2, 3}; int[] arr2 = new int[3]; arr2 = arr1; arr2[0] = 10; System.out.println(arr1[0]);?
Back
B) 10
2.
FLASHCARD QUESTION
Front
Which of the following code snippets will result in a compilation error?
Back
C) char letters[] = new char[3]; letters[3] = 'A';
3.
FLASHCARD QUESTION
Front
What will be the output of the following code: int[] arr = {1, 2, 3, 4}; System.out.println(arr[arr.length - 1]);?
Back
B) 4
4.
FLASHCARD QUESTION
Front
What will happen when the following code is executed: String[] fruits = {"Apple", "Banana", "Orange"}; System.out.println(fruits[fruits.length]);?
Back
C) An ArrayIndexOutOfBoundsException will be thrown.
5.
FLASHCARD QUESTION
Front
If the base address in a 1D integer array arr is 2000, and each integer takes 4 bytes, what will be the address of the 5th element (arr[4])?
Back
C) 2016
6.
FLASHCARD QUESTION
Front
Identify the issue in the following computed addressing formula in a 1D Array: Address = Base Address + (Index + 1) * Element Size
Back
A) It will compute the wrong address for the first element.
7.
FLASHCARD QUESTION
Front
If ArrayKo is an integer array having 6 elements with a base address of 1000, and each integer occupies 2 bytes, what happens if you try to access A[6]?
Back
C) It will result in an out-of-bounds error if the array has more than 6 elements.
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
40 questions
TES SUMATIF BAHASA 7 Ganjil
Flashcard
•
7th Grade
25 questions
Geometry and Data Interpretation Flashcard
Flashcard
•
4th Grade
25 questions
Science 5-Third Quarter Summative Test 1
Flashcard
•
5th Grade
48 questions
Ôn tập tổng hợp Chinese kids
Flashcard
•
1st Grade
40 questions
GRADE 3 - Q3 ENGLISH REVIEWER
Flashcard
•
3rd Grade
37 questions
I6A Unit 5 Listening Business
Flashcard
•
3rd Grade
37 questions
KET高级课程第11单元重点词汇
Flashcard
•
1st Grade
50 questions
Science Bee Practice - General Science
Flashcard
•
6th - 8th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for Other
14 questions
Contractions
Quiz
•
2nd Grade
10 questions
Exploring Rosa Parks and Black History Month
Interactive video
•
1st - 5th Grade
20 questions
Counting Coins
Quiz
•
2nd Grade
20 questions
Place Value
Quiz
•
KG - 3rd Grade
19 questions
Subject-Verb Agreement
Quiz
•
2nd - 5th Grade
13 questions
Fractions
Quiz
•
1st - 2nd Grade
12 questions
2-Digit Subtraction with Regrouping
Quiz
•
2nd Grade
14 questions
Fractions
Quiz
•
2nd - 3rd Grade