| 31. |
Which of these have highest precedence?
|
||||||||
|
Answer:
Option (a) |
| 32. |
What should be expression1 evaluate to in using ternary operator as in this line?
expression1 ? expression2 : expression3
|
||||||||
|
Answer:
Option (c) |
| 33. |
What is the value stored in x in the following lines of Java code?
int x, y, z;
x = 0;
y = 1;
x = y = z = 8;
|
||||||||
|
Answer:
Option (d) |
| 34. |
What is the order of precedence (highest to lowest) of following operators?
1. &
2. ^
3. ?:
|
||||||||
|
Answer:
Option (a) |
| 35. |
Which of these statements are incorrect?
|
||||||||
|
Answer:
Option (c) |
| 36. |
What will be the output of the following Java code?
class operators
{
public static void main(String args[])
{
int var1 = 5;
int var2 = 6;
int var3;
var3 = ++ var2 * var1 / var2 + var2;
System.out.print(var3);
}
}
|
||||||||
|
Answer:
Option (c) |
| 37. |
What will be the output of the following Java code?
class operators
{
public static void main(String args[])
{
int x = 8;
System.out.println(++x * 3 + " " + x);
}
}
|
||||||||
|
Answer:
Option (d) |
| 38. |
What will be the output of the following Java code?
class Output
{
public static void main(String args[])
{
int x=y=z=20;
}
}
|
||||||||
|
Answer:
Option (d) |
| 39. |
What will be the output of the following Java program?
class Output
{
public static void main(String args[])
{
int a,b,c,d;
a=b=c=d=20
a+=b-=c*=d/=20
System.out.println(a+" "+b+" "+c+" "+d);
}
}
|
||||||||
|
Answer:
Option (c) |
| 40. |
Which of the following is not OOPS concept in Java?
|
||||||||
|
Answer:
Option (d) |