MCQOPTIONS
Bookmark
Saved Bookmarks
→
Java Programming
→
Exceptions
→
Decrement operator, , decreases value of variabl..
1.
Decrement operator, , decreases value of variable by what number?
A.
4
B.
1
C.
2
D.
3
E.
None of these
Answer» C. 2
Show Answer
Discussion
No Comment Found
Post Comment
Related MCQs
With x = 0, which of the following are legal lines of Java code for changing the value of x to 1?<br><pre class="prettyprint lang-c"><br> 1. x++;<br> 2. x = x + 1;<br> 3. x += 1;<br> 4. x =+ 1;<br></pre>
On applying Left shift operator, < <ol class="list-group" style="color: #9d426b; margin-bottom: 0px;"> <li class="list-group-item" style="font-size:18px;border:none; padding: 0 0 0 0px; margin: 0 0 0 30px; color:#EB586F;"> <div class="row" style="margin-right: 0px;"> <ol style="color: #9d426b; list-style: upper-alpha;font-weight:bold;margin-bottom: 0px; color: #9d426b;"> <li style="display: list-item;border:none; list-style-type: upper-alpha;color:#EB586F;font-size:20px;padding: 10px 10px 10px 0px; margin: 0 0 0 30px;font-weight: normal;"> <span style="color:#888;font-size:16px;">32</span> </li> <li style="display: list-item;border:none; list-style-type: upper-alpha;color:#EB586F;font-size:20px;padding: 10px 10px 10px 0px; margin: 0 0 0 30px;font-weight: normal;"> <span style="color:#888;font-size:16px;">31</span> </li> <li style="display: list-item;border:none; list-style-type: upper-alpha;color:#EB586F;font-size:20px;padding: 10px 10px 10px 0px; margin: 0 0 0 30px;font-weight: normal;"> <span style="color:#888;font-size:16px;">33</span> </li> <li style="display: list-item;border:none; list-style-type: upper-alpha;color:#EB586F;font-size:20px;padding: 10px 10px 10px 0px; margin: 0 0 0 30px;font-weight: normal;"> <span style="color:#888; font-size:16px;">1</span> </li> <li style="display: list-item;border:none; list-style-type: upper-alpha;color:#EB586F;font-size:20px;padding: 10px 10px 10px 0px; margin: 0 0 0 30px;font-weight: normal;"> <span style="color:#888; font-size:16px;">None of these</span> </li> </ol> </div> </li> </ol>
What is the output of this program?<br><pre class="prettyprint lang-c"><br>public class Output <br> {<br> public static void main(String args[]) <br> { <br> int p = 5;<br> int q = 7;<br> int r;<br> int s;<br> r = ++q;<br> s = p++;<br> r++;<br> q++;<br> ++p;<br> System.out.println(p + " " + q + " " + r);<br> } <br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c"><br>public class RightShift_Operator <br> {<br> public static void main(String args[]) <br> { <br> int a; <br> a = 100;<br> a = a >> 1;<br> System.out.println(a);<br> } <br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c"><br>public class LeftShift_Operator <br> {<br> public static void main(String args[]) <br> { <br> byte A = 65;<br> int i;<br> byte b; <br> i = A << 2;<br> b = (byte) (A << 2);<br> System.out.print(i + " " + b);<br> } <br> }<br></pre>
Which of the following operators can operate on a boolean variable?<br><pre class="prettyprint lang-c"><br> 1. &&<br> 2. ==<br> 3. ?:<br> 4. +=<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c"><br>public class Output <br> {<br> public static void main(String args[]) <br> { <br> int p = 5;<br> int q = 6;<br> int r = 7;<br> p |= 4;<br> q >>= 1;<br> r <<= 1;<br> p ^= r;<br> System.out.println(p + " " + q + " " + r);<br> } <br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c"><br>public class ternary_operator_Example<br> {<br> public static void main(String args[]) <br> { <br> int a = 5;<br> int b = ~ a;<br> int c;<br> c = a > b ? a : b;<br> System.out.print(c);<br> } <br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c"><br>public class bool_operator_Example<br> {<br> public static void main(String args[]) <br> { <br> boolean p = true;<br> boolean q = !true;<br> boolean r = p | q;<br> boolean s = p & q;<br> boolean z = s ? q : r;<br> System.out.println(s + " " + z);<br> } <br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c"><br>public class Relational_operator_Example<br> {<br> public static void main(String args[])<br> {<br> int num1 = 7; <br> int num2 = 6;<br> System.out.print(num1 > num2);<br> } <br> }<br></pre>
Reply to Comment
×
Name
*
Email
*
Comment
*
Submit Reply