
Operators
Authored by Jose Diaz
Computers
1st Grade
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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.
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
10 questions
Advanced SQL
Quiz
•
KG - University
10 questions
HT3 Digital Graphics
Quiz
•
KG - 12th Grade
14 questions
Bài kiểm tra cuối kì 1
Quiz
•
1st - 7th Grade
10 questions
Pernyataan Function dan Procedure
Quiz
•
1st - 3rd Grade
10 questions
Global Warming (ग्लोबल वार्मिंग)
Quiz
•
1st - 5th Grade
10 questions
Fun with Paint and Storage
Quiz
•
1st Grade - University
13 questions
CHƯƠNG 9
Quiz
•
1st - 5th Grade
11 questions
Standby PSPM SC015
Quiz
•
1st - 5th Grade
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 Computers
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