Question 1
1
5
6
12
Good Job!
Oops!
the length of the array byte[] data = { 12, 34, 9, 0, -62, 88 } is 6 because the array byte contains 6 elements.
Please login to submit your explanation
You can check your performance of this question after Login/Signup
Start
Question 2
java.util
ArrayList
java.lang
None of the mentioned
java.lang is a package that Provides classes that are fundamental to the design of the Java programming language.
Question 3
int[] arr = { 2, 4, 6, 8, 10, 1, 3, 5, 7, 9 } for ( int index= 0 ; index < 5 ; index++ ) System.out.print( arr[ index ] + " " );
2 4 6 8
2 4 6 8 10
2 4 6 8 10 1
2 4 6 8 10 1 3 5 7 9
output is 2 4 6 8 10 the for loop will run from i =0 to i=5 and print the each index in array
Question 4
int[] arr = { 2, 4, 6, 8, 10, 1, 3, 5, 7, 9 }; for ( int index= 0 ; index < egArray.length ; index++ ) System.out.print( arr[ index ] + " " );
Question 5
+
+=
&
||
+ + is use to concatinate the strings in java
Question 6
CHARAT()
charat()
charAt()
ChatAt()
charAt() charAt() is a keyword used to access a particular index
Question 7
string()
String(void)
String(0)
Question 8
int[] egArray = { 2, 4, 6, 8, 10, 1, 3, 5, 7, 9 }; for ( int index= 0 ; index < egArray.length ; index = index + 2 ) System.out.print( egArray[ index ] + " " );
4 8 1 5 9
2 6 10 3 7
2 6 10 3 7 0
2 6 10 3 7 the loop will skip a index in array as we are incrementing 2
Question 9
Yes---the program will not compile without the length being declared.
No---the array object is created when the program is running, and the length might change from run to run.
Yes---otherwise the program will not run correctly.
No---arrays can grow to whatever length is needed.
the array size can differ depending on the use case
Question 10
int[] egArray = { 2, 4, 6, 8, 10, 1, 3, 5, 7, 9 }; for ( int index= ________ ; _____________ ; ______________ ) System.out.print( egArray[ index ] + " " );
index = 0; index < egArray.length; index--
index = length; index < 0; index--
index = egArray.length-1; index >= 0; index--
index = length-1; index > 0; index--
index=length-1 ; index>0;index-- since we need to reverse the array we can access the array in for loop from the last index and decrement it till it reach 0 index
Please login to report
Login/Signup
Personalized Analytics only Availble for Logged in users
Analytics below shows your performance in various Mocks on PrepInsta
Your average Analytics for this Quiz
Rank
-
Percentile
0%
Completed
0/0
Accuracy
April 2, 2021