
Operators

Quiz
•
Computers
•
1st Grade
•
Hard
Jose Diaz
Used 1+ times
FREE Resource
9 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
2 mins • 1 pt
Given:
byte b = 1;
char c = 1;
short s = 1;
int i = 1;
which of the following expressions are valid?. Select 3 options.
s = b * b ;
i = b + b ;
s *= b ;
c = c + b ;
float f = 2%s+c;
2.
MULTIPLE SELECT QUESTION
2 mins • 1 pt
Which of the following statements will compile without any error?. Please select 3 options
System.out.println("a"+'b'+63);
System.out.println("a"+63);
System.out.println('b'+ Integer.valueOf(63));
String s = 63 + Integer.valueOf(10);
String valueStr = (String) (63 + Integer.valueof(10));
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Consider the following lines of code:
System.out.println(null + true); //1
System.out.println(true + null); //2
System.out.println(null + null); //3
Which of the following statements are correct?. Please select 1 option.
None of the 3 lines will compile.
All the 3 lines will compile and print nulltrue, truenull and nullnull respectively.
Line 1 and 2 won't compile but line 3 will print nullnull.
Line 3 won't compile but line 1 and 2 will print nulltrue and truenull respectively.
None of the above.
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will the following code print?
int i1 = 1, i2 = 2, i3 = 3;
float i4 = i1 + (i2=i3 );
System.out.println((int)i4);
Please select 1 option.
4
4.0
4.0f
It will not compile.
5.
MULTIPLE SELECT QUESTION
2 mins • 1 pt
Which of the following operators can be used in conjunction with a String object?. Plese select 3 options
+
+ +
+=
.
*
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Consider the following lines of code:
boolean greenLight = true;
boolean pedestrian = false;
boolean rightTurn = true;
boolean otherLane = false;
You can go ahead only if the following expression evaluates to 'true' :
(( (rightTurn && !pedestrian || otherLane)
|| ( ? && !pedestrian && greenLight ) ) == true )
What variables can you put in place of '?' so that you can go ahead?
Please select 1 option.
rightTurn
otherLane
Any variable would do.
None of the variable would allow to go.
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will the following code print?
int i = 0;
int j = 1;
if( (i++ == 0) & (j++ == 2) ){
i = 12;
}
System.out.println(i+" "+j);
Please select 1 option.
1 2
2 3
12 2
12 1
It will not compile.
8.
MULTIPLE SELECT QUESTION
2 mins • 1 pt
Which of the following are also known as "short circuiting logical operators"?. Please select 2 options.
&
||
&&
|
^
9.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will the following class print ?
class InitTest{
public static void main(String[] args){
int a = 10;
int b = 20;
a += (a = 4);
b = b + (b = 5);
System.out.println(a+ ", "+b);
}
}
Please select 1 option.
8, 25
4, 5
14, 5
4, 25
14, 25
Similar Resources on Wayground
6 questions
Создание массивов в Пайтон

Quiz
•
KG - Professional Dev...
10 questions
Programación Java

Quiz
•
1st Grade
10 questions
Программирование C#

Quiz
•
1st - 10th Grade
10 questions
Python-Partie2

Quiz
•
1st Grade
13 questions
Tutoría N1

Quiz
•
1st - 3rd Grade
10 questions
P9-PSeInt

Quiz
•
1st - 10th Grade
12 questions
Python М1-М3

Quiz
•
1st Grade
5 questions
Java expression & operators

Quiz
•
1st - 4th Grade
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
18 questions
D189 1st Grade OG 1c Concept 37-38

Quiz
•
1st Grade
20 questions
addition

Quiz
•
1st - 3rd Grade
20 questions
Subject and predicate in sentences

Quiz
•
1st - 3rd Grade
20 questions
Addition and Subtraction facts

Quiz
•
1st - 3rd Grade
20 questions
Place Value

Quiz
•
KG - 3rd Grade
10 questions
Exploring Properties of Matter

Interactive video
•
1st - 5th Grade
5 questions
Life at a pond

Quiz
•
1st Grade
14 questions
Plural Nouns Adding s and es

Quiz
•
1st - 2nd Grade