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 5168
Q:

Which Governor General of India used to write poetry with the name of "Owen Meredith"?

 

A) Lord Dalhousie B) Lord Ripon
C) Lord Lytton D) Lord Canning
 
Answer & Explanation Answer: C) Lord Lytton

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Politics
Exam Prep: Bank Exams

0 5168
Q:

Leakage of which of the following gases caused the Bhopal gas tragedy ?

A) Carbon monoxide B) Methyl isocyanate
C) Nitrous oxide D) Hydrogen sulphide
 
Answer & Explanation Answer: B) Methyl isocyanate

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Chemistry
Exam Prep: AIEEE
Job Role: Analyst

15 5165
Q:

The great law given of ancient times was

A) Manu B) Vatsyayana
C) Ashoka D) Aryabhatta
 
Answer & Explanation Answer: A) Manu

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian History

2 5160
Q:

Generally covalently bonded molecules ______.

 

I. have high boiling and melting point as compare to ionically bonded molecules

II. poor conductors of electricity

III. have weak intermolecular force

 

A) Only I and II B) Only I and III
C) Only II and III D) All I, II and III
 
Answer & Explanation Answer: C) Only II and III

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Chemistry
Exam Prep: Bank Exams

1 5158
Q:

Which of these is the best description of fixed expenses?

 

A) Insurance B) Payment on loans
C) Rent D) All the above
 
Answer & Explanation Answer: D) All the above

Explanation:

Fixed expenses are those expenses that do not change when there is a change in production or sales level.

 

Examples of Fixed Expenses are rent, insurance, payment on loans, salaries, advertising, etc...

 

Report Error

View Answer Report Error Discuss

Filed Under: Indian Economy
Exam Prep: Bank Exams

0 5154
Q:

Select the word with the correct spelling.

 

A) oxidieser B) thespian
C) aproval D) secreetes
 
Answer & Explanation Answer: B) thespian

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: English
Exam Prep: Bank Exams

0 5152
Q:

The method of Constitutional Amendment is provided in 

A) Article 348 B) Article 358
C) Article 368 D) Article 378
 
Answer & Explanation Answer: C) Article 368

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Politics

6 5151