Questions

Q:

What is the output after compile and run the following code ?

int Output = 10;
boolean b = false;
if((b == true) && ((Output += 10) == 20))
{
System.out.println("We are equal " + Output);
}
else
{
System.out.println("Not equal! " + Output);
}

A) Compilation and output of "We are equal 10" B) Compilation and output of "Not equal! 10"
C) Compilation error, attempting to perform binary comparison on logical data type D) Compilation and output of "Not equal! 20"
 
Answer & Explanation Answer: B) Compilation and output of "Not equal! 10"

Explanation:

The output will be "Not equal! 10". Please note that && is logical AND operator. If first operand before (&&) is false then the other operand will not be evaluated. This illustrates that the Output +=10 calculation was never performed because processing stopped after the first operand was evaluated to be false. If you change the value of b1 to true, processing occurs as you would expect and the output would be "We are equal 20".

Report Error

View Answer Report Error Discuss

Filed Under: Oracle Certification
Job Role: Analyst

6 5075
Q:

Which of the statements given below are correct?

1. The author of the novel 'Gilead' is Don Winslow.
2. The author of the novel 'Wolf Hall' is Stephen Dobyns.
3. The author of the novel 'To Kill a Mockingbird' is Harper Lee.

A) 1 and 2 B) 2 and 3
C) 1 and 3 D) 1, 2 and 3
 
Answer & Explanation Answer: A) 1 and 2

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Books and Authors
Exam Prep: Bank Exams

0 5074
Q:

Africa is seperated from Europe by

A) Red Sea B) Mediterranean Sea
C) Atlantic Ocean D) Persian Gulf
 
Answer & Explanation Answer: B) Mediterranean Sea

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: General Awareness

17 5074
Q:

Number of basic SI unit is

A) 4 B) 7
C) 6 D) 5
 
Answer & Explanation Answer: B) 7

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Physics

6 5074
Q:

Solve the following equations and find the value of abc?

 

A) 3 B) 6
C) 9 D) 12
 
Answer & Explanation Answer: B) 6

Explanation:

From the given equations,

(a+b+c)2=a2+b2+c2+2(ab+bc+ca)
(6)2=14 + 2(ab + bc + ca)
36 - 14 = 2(ab + bc + ca)
22/2 = ab + bc + ca
ab + bc + ca = 11

a3 + b3 + c3 - 3abc = (a + b + c)(a2 + b2 + c2 - ab - bc - ca)
= (6) (14 - 11)
=(6)(3)
=18

Since, a3 + b3 + c3 - 3abc = 18

36 - 3abc = 18

-3abc = 18 - 36

-3abc = -18

abc = 6.

Report Error

View Answer Report Error Discuss

Filed Under: Math Puzzles
Exam Prep: Bank Exams , CAT

24 5072
Q:

Dome mountain are the result of

A) Intrusion of magma B) Folding
C) Frictions at the joints of the rocks D) Faulting
 
Answer & Explanation Answer: A) Intrusion of magma

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: World Geography

5 5072
Q:

An atom bomb based upon the principal of ________

A) Nuclear fission B) Nuclear fussion
C) Controlled chain reaction D) None of these
 
Answer & Explanation Answer: A) Nuclear fission

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Physics

7 5071
Q:

...................is called the "land of a  thousand lakes"

A) Canada B) Finland
C) Switzerland D) Sweden
 
Answer & Explanation Answer: B) Finland

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: World Geography

8 5070