
JP-Quiz-1

Quiz
•
Computers
•
University
•
Hard
Jeena KK
Used 1+ times
FREE Resource
18 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
String og = "helloworld";
String og2 = new String(og);
System.out.println((og==og2) + " "+ (og.equals(og2)));
true true
true false
false true
false false
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
int five = 5;
int two = 2;
int total = five + (five > 6 ? ++two : --two);
1
2
4
6
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which one is not a valid statement in Java?
double num = 2.718;
double num = 2._718;
double num = 2.7_1_8;
double num = 2.718;
double num = 2._718;
double num = 2.7_1_8;
none
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
How many strings can be collected by Garbage Collector in the following code snippet?
public static void main(String[] fruits) {
String str1 = new String("open");
String str2 = new String("source");
String str2 = new String("opengenus");
str3 = str1;
str2 = str3;
str1 = str2;
}
0
1
2
3
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What line in this code snippet will give compilation error?
double d1 = 5f; // c1
double d2 = 5.0; // c2
float f1 = 5f; // c3
float f2 = 5.0; // c4
c1
c2
c3
c4
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following code snippet?
public static void main(String... args) {
String car, bus = "petrol";
car = car + bus;
System.out.println(car); }
petrol
petrolpetrol
Compilation error
Runtime error
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which code statement give compilation error?
double num1, int num2 = 1; // C1
int num1, num2; // C2
int num1, num2 = 1; // C3
int num1 = 2, num2 = 1; // C4
c1
c2
c3
c4
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Milking Minds 2 17-01-24

Quiz
•
University
20 questions
Pointers

Quiz
•
University
13 questions
#include <\c>

Quiz
•
University
15 questions
HCI 584 Python quiz

Quiz
•
University
20 questions
Quiz

Quiz
•
University
15 questions
Quiz 3 - CSE C

Quiz
•
University
20 questions
Day 6 - ONLINE TEST - PL03 PYTHON PROGRAMMING

Quiz
•
University
15 questions
Java Bootcamp Day 4

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

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

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

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

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University