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

Logical puzzle

 A boy and a girl are talking.
"I am a boy" - said the child with black hair.
"I am a girl"  - said the child with white hair.

At least one of them lied. Who is the boy and who is the girl?

Answer

Our Solution:


They both lied.
The child with the black hair is the girl, and the child with the white hair is the boy.
(If only one lied they would both be boys or both be girls)

Report Error

View answer Workspace Report Error Discuss

Subject: Logic Puzzles

18 5183
Q:

Select the odd term out of the following?

A) Internet B) Macintosh OSX
C) Linux Mint D) Windows 8.1
 
Answer & Explanation Answer: A) Internet

Explanation:

Internet is not an operating system.

Report Error

View Answer Report Error Discuss

17 5183
Q:

The last Mauryan king was

A) Pushyamitra Sunga B) Ashoka
C) Harsa D) Brihadratha
 
Answer & Explanation Answer: D) Brihadratha

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian History

5 5179
Q:

Chipko movement was basically against

A) Cultural pollution B) Deforestation
C) Water pollution D) Noise pollution
 
Answer & Explanation Answer: B) Deforestation

Explanation:

The Chipko movement or Chipko Andolan refers to a forest conservation movement or deforestation. In modern india, it began in 1973 in the state of Uttar Pradesh (now Uttarakhand). Sunderlal Bahuguna and 84 villagers risked their lives to protect the forest trees from being felled on the order of the maharaja (king) and went on to become a rallying point for many future environmental movements all over the world it created a precedent for starting of nonviolent protest in India, and its success meant that the world immediately took notice of this non violent movement, which was to inspire in time many such eco-groups by helping to slow down the rapid deforestation, expose vested interests, increase ecological awareness, and demonstrate the viability of people power. Above all, it stirred up the existing civil society in India, which began to address the issues of tribal and marginalized people.

 

Chipko type movement dates back to 1730 AD when in a khejarli village of Rajasthan, 363 people sacrificed their lives to save khejari trees.

Report Error

View Answer Report Error Discuss

Filed Under: Indian History
Exam Prep: AIEEE , Bank Exams , CAT , GATE
Job Role: Analyst , Bank Clerk , Bank PO , Database Administration

8 5178
Q:

The purpose of the inclusion of Directive Principle of  State Policy in the Indian Constitution is to establish:

A) Political democracy B) Social democracy
C) Gandhian democracy D) Social and economic democracy
 
Answer & Explanation Answer: D) Social and economic democracy

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Politics

5 5178
Q:

What does the acronym CTBT stand for?

A) Continued Test Ban Treaty B) Commercial Test Based Traiff
C) Continue Test Based Treatment D) Comprehensive Test Ban Treaty
 
Answer & Explanation Answer: D) Comprehensive Test Ban Treaty

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: General Awareness

33 5177
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 5173