
Collection2
Authored by khushbu mehta
Philosophy
1st Grade
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
5 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Which of the following are true about the following code? (Choose all that apply)
public class Create {
Create() { System.out.print("1 "); }
Create(int num) {
System.out.print("2 "); }
Create(Integer num) {
System.out.print("3 "); }
Create(Object num) {
System.out.print("4 "); }
Create(int... nums) { System.out.print("5 "); }
public static void main(String[] args) {
new Create(100);
new Create(1000L); } }
2 4
3 4
2 5
compile error
2.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Which of the following lambda expressions can fill in the blank?
List list = new ArrayList<>();
list.removeIf(___________________);
s -> s.isEmpty()
s -> {s.isEmpty()}
s -> {s.isEmpty();}
s -> {return s.isEmpty();}
3.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
What is the result of the following statements?
3: ArrayList<Integer> values = new ArrayList<>();
4: values.add(4);
5: values.add(5);
6: values.set(1, 6);
7: values.remove(0);
8: for (Integer v : values)
System.out.print(v);
5
6
4
compile error
4.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
What will be the output?
List<Integer> ages = new ArrayList<>();
ages.add(Integer.parseInt("5"));
ages.add(Integer.valueOf("6"));
ages.add(7);
ages.add(null);
for (int age : ages) System.out.print(age);
5 6 7
Compilation error
Runtime exception
5.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
List<String> one = new ArrayList<String>();
one.add("abc");
List<String> two = new ArrayList<>();
two.add("abc");
if (one == two)
System.out.println("A");
else if (one.equals(two))
System.out.println("B");
else
System.out.println("C");
A
B
C
Run time exception
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
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 Philosophy
20 questions
Telling Time to the Hour and Half hour
Quiz
•
1st Grade
10 questions
Exploring Rosa Parks and Black History Month
Interactive video
•
1st - 5th Grade
20 questions
Place Value
Quiz
•
KG - 3rd Grade
13 questions
Fractions
Quiz
•
1st - 2nd Grade
20 questions
CVC Words
Quiz
•
KG - 1st Grade
15 questions
Place Value tens and ones
Quiz
•
1st Grade
16 questions
Money - Coins
Lesson
•
1st - 2nd Grade
20 questions
Halves and Fourths
Quiz
•
1st Grade