
Java Operators
Authored by GOKUL C [CIR]
Computers
University
Used 18+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
129 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
1 min • 1 pt
Which statement(s) are equivalent to i = i + 1?
i += 1
i++
i -= 1
i--
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
++ increases the value of a variable by 1
assignment operator
decrement operator
increment operator
sentinel
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What's the value of below?
int i=5;
System.out.println(i++);
System.out.println(i);
System.out.println(++i);
5
6
7
6
6
7
6
7
8
5
5
6
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What would the new value of A be?
A=1;
a++;
1
2
3
4
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Please write correct output in following space-
10
20
No Output
Error
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Find the output for the following.
public class IncDec
{
public static void main(String s[])
{
int a = 1;
int b = 2;
int c;
int d;
c = ++b;
d = a++;
c++;
System.out.println("a = " + a);
System.out.print("b = " + b);
System.out.println("c = " + c);
System.out.print("d = " + d);
}
}
a = 2 b = 3 c = 4 d = 1
a = 2 b = 3 c = 4 d = 1
Program does not compile.
a = 1 b = 2 c = 4 d = 2
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the program?
class Test
{
public static void main(String [] args)
{
int x=20;
String sup = (x < 15) ? "small" : (x < 22)? "tiny" : "huge";
System.out.println(sup);
}
}
small
tiny
huge
Compilation fails
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
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