
Milestone 1 - Assignments, Expression, Operators

Quiz
•
Computers
•
University
•
Hard
Prema,Asst.Prof, Chennai
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which one of the below expression is equivalent to 16>>2 ?
16/4
16/2
16*2
16/2^2
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is correct?
8>> 2 gives 2
16 >>> 2 gives 2
4 << 2 gives 2
2 << 1 gives 2
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given the following code snippet:
double sum = 10.0, price=100;
sum += price>=100 ? price*1.1 : price;
What value is placed in sum? Choose the most appropriate answer.
90
100
110
120
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given the variables defined below:
int one = 1;
int two = 2;
char initial = ‘2’;
boolean flag = true;
Which one of the following is invalid?
if( one == two ){}
switch( one ){}
switch( flag ){}
switch( initial ){}
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
public class TestOperator {
public static void main(String[] args)
{
byte x = 0x0F;
byte y = 0x08;
byte z = x & y;
System.out.println(z);
}
}
What is the result?
8
15
23
Compilation error
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
public class TestExpression {
private static int value=0;
private static boolean method2(int k)
{
value+=k;
return true;
}
public static void method1(int index)
{
boolean b;
b = index >= 15 && method2(30);
b = index >= 15 & method2(15);
}
public static void main ( String args[])
{
method1(0);
System.out.println(value);
}
}
What is the output?
0
15
30
45
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given:
public class TestOperator
{
int x=15;
public void method(int x)
{
x+=x;
System.out.println(x);
}
public static void main(String... args)
{
TestOperator t = new TestOperator();
t.method(10);
}
}
What is the output of the above code?
10
20
25
30
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Round 4 - Harvest

Quiz
•
University
6 questions
Java Method Overloading

Quiz
•
University
5 questions
Java Classes & Objects

Quiz
•
University
12 questions
Chapter 2-1: Array Part 1

Quiz
•
University
10 questions
Introduction to Arrays

Quiz
•
KG - University
13 questions
Java Practice Quiz on Exception Handling

Quiz
•
University
10 questions
BCSC0006 - Quiz 1 - Arrays

Quiz
•
University
10 questions
Programming Quiz

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

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

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University