IndiaBIX.com
Arithmetic Aptitude Data Interpretation
Logical Reasoning Verbal Reasoning Non Verbal Reasoning
General Knowledge
Sudoku Number puzzles Missing letters puzzles Logical puzzles Playing cards puzzles Clock puzzles
C Programming C++ Programming C# Programming Java Programming
Microbiology Biochemistry Biotechnology Biochemical Engineering
Civil Engineering Mechanical Engineering Chemical Engineering Networking Database Questions Computer Science Basic Electronics Digital Electronics Electronic Devices Circuit Simulation Electrical Enigneering Engineering Mechanics Technical Drawing
Placement Papers Group Disucssion HR Interview Technical Interview Body Language
Aptitude Test Verbal Ability Test Verbal Reasoning Test Logical Reasoning Test C Programming Test Java Programming Test Data Interpretation Test General Knowledge Test
Data Structures Operating Systems Networking DATABASE Database Basics SQL Server Basics SQL Server Advanced SQL Server 2008 JAVA Core Java Java Basics Advanced Java UNIX Unix File Management Unix Memory Management Unix Process Managemnt C Interview Questions The C Language Basics .NET Interview Questions .NET Framework ADO.NET ASP.NET Software Testing

Java Programming - Java.lang Class

@ : Home > Java Programming > Java.lang Class > Pointing out the correct statements

Exercise

"You cannot shake hands with a clenched fist."
- Indira Gandhi
1. 

Which statement is true given the following?

Double d = Math.random();

A. 0.0 < d <= 1.0
B. 0.0 <= d < 1.0
C. Compilation fail
D. Cannot say.

2. 

Which two statements are true about wrapper or String classes?

  1. If x and y refer to instances of different wrapper classes, then the fragment x.equals(y) will cause a compiler failure.
  2. If x and y refer to instances of different wrapper classes, then x == y can sometimes be true.
  3. If x and y are String references and if x.equals(y) is true, then x == y is true.
  4. If x, y, and z refer to instances of wrapper classes and x.equals(y) is true, and y.equals(z) is true, then z.equals(x) will always be true.
  5. If x and y are String references and x == y is true, then y.equals(x) will be true.

A. 1 and 2
B. 2 and 3
C. 3 and 4
D. 4 and 5

3. 

Which of the following will produce an answer that is closest in value to a double, d, while not being greater than d?

A. (int)Math.min(d);
B. (int)Math.max(d);
C. (int)Math.abs(d);
D. (int)Math.floor(d);

4. 

What two statements are true about the result obtained from calling Math.random()?

  1. The result is less than 0.0.
  2. The result is greater than or equal to 0.0..
  3. The result is less than 1.0.
  4. The result is greater than 1.0.
  5. The result is greater than or equal to 1.0.

A. 1 and 2
B. 2 and 3
C. 3 and 4
D. 4 and 5


© 2008-2013 by IndiaBIX™ Technologies. All Rights Reserved | Copyright | Terms of Use & Privacy Policy

Contact us: info@indiabix.com     Follow us on twitter!