Java Increment & Decrement Operators and assignment statements

Quiz
•
Computers
•
Professional Development
•
Hard
Kim Bowman
Used 13+ times
FREE Resource
Student preview

10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
++ increases the value of a variable by 1
assignment operator
decrement operator
increment operator
sentinel
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
--; decreases the value of a variable by 1
assignment operator
decrement operator
increment operator
sentinel
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What would the new value of A be?
A=1;
a++;
1
2
3
4
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What would the new value of A be?
A=1;
A--;
0
1
2
-1
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What value will print to the screen for i?
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
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
++i and i++ cannot be used anywhere for the same purpose
true
false
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What does the following code output?
int x = 1;
System.out.println(x++);
1
2
compilation error
runtime error
Create a free account and access millions of resources
Popular Resources on Wayground
15 questions
Hersheys' Travels Quiz (AM)

Quiz
•
6th - 8th Grade
20 questions
PBIS-HGMS

Quiz
•
6th - 8th Grade
30 questions
Lufkin Road Middle School Student Handbook & Policies Assessment

Quiz
•
7th Grade
20 questions
Multiplication Facts

Quiz
•
3rd Grade
17 questions
MIXED Factoring Review

Quiz
•
KG - University
10 questions
Laws of Exponents

Quiz
•
9th Grade
10 questions
Characterization

Quiz
•
3rd - 7th Grade
10 questions
Multiply Fractions

Quiz
•
6th Grade