
make-up

Quiz
•
Computers
•
University
•
Hard
Udayveer Singh
Used 2+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following application?
package registration;
public class NameCheck
{
public static void main(String... data)
{
String john = "john";
String jon = new String(john);
System.out.print((john==jon)+" "+(john.equals(jon)));
}
}
A. true true
B. true false
C. false true
D. false false
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which statement immediately exits a switch statement, skipping all remaining case or default branches?
A. exit
B. break
C. goto
D. continue
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many instance initializers are in this code?
1: public class Bowling {
2: { System.out.println(); }
3: public Bowling () {
4: System.out.println();
5: }
6: static { System.out.println(); }
7: { System.out.println(); }
8: }
A. None
B. One
C. Two
D. Three
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following?
var teams = new String("694");
teams.concat(" 1155") ;
teams.concat(" 2265") ;
teams. concat(" 2869");
System. out. println (teams) ;
A. 694
B. 694 1155 2265 2869
C. The code compiles but outputs something else.
D. The code does not compile.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet?
int count = 0;
var stops = new String[] { "Washington", "Monroe", "Jackson", "LaSalle" };
while (count ‹ stops. length)
if (stops[++count]. length () < 8)
break;
else continue;
System. out. println (count) ;
A. 0
B. 1
C. 2
D. 3
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Java program?
class Output
{
public static void main(String args[])
{
int a,b,c,d;
a=b=c=d=20;
a+=b-=c*=d/=20;
System.out.println(a+" "+b+" "+c+" "+d);
}
}
a) compile time error
b) runtime error
c) a=20 b=0 c=20 d=1
d) none of the mentioned
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the minimum number of lines that need to be removed to make this code compile?
@FunctionalInterface
public interface Play {
public static void baseball () {}
private static void soccer () {}
default void play() {}
void fun ();
}
A. One
B. Two
C. Three
E. The code compiles as is.
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Java Control Flow statements

Quiz
•
University
12 questions
javaquizvivek

Quiz
•
University
20 questions
Java Quiz 1

Quiz
•
University
18 questions
Java thread - MCQ

Quiz
•
University
15 questions
Array Java

Quiz
•
University
13 questions
APCSA Quiz 1

Quiz
•
9th Grade - University
13 questions
OOP evaluation

Quiz
•
University
20 questions
2-mavzu. Kotlin dasturlash tilida tarmoqlanuvchi, takrorlanuvchi

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University