Sail E0 Webinar

MCQs

Total Questions : 19 | Page 2 of 2 pages
Question 11. Which of these class can encapsulate an entire executing program?
  1.    Void
  2.    Process
  3.    Runtime
  4.    System
 Discuss Question
Answer: Option B. -> Process


Process


Question 12. Standard output variable 'out' is defined in which class?
  1.    Void
  2.    Process
  3.    Runtime
  4.    System
 Discuss Question
Answer: Option D. -> System


Standard output variable 'out' is defined in System class. out is usually used in print statement i:e System.out.print()


Question 13. Which of the following is method of System class is used to find how long a program takes to execute?
  1.    currenttime()
  2.    currentTime()
  3.    currentTimeMillis()
  4.    currenttimeMillis()
 Discuss Question
Answer: Option C. -> currentTimeMillis()


currentTimeMillis()


Question 14. Which of these class holds a collection of static methods and variables?
  1.    Void
  2.    Process
  3.    Runtime
  4.    System
 Discuss Question
Answer: Option D. -> System


System class holds a collection of static methods and variables. The standard input, output and error output of java run time are stored in the in, out and err variables of System class.


Question 15. Which of the following package stores all the simple data types in java?
  1.    lang
  2.    java
  3.    util
  4.    java.packages
 Discuss Question
Answer: Option A. -> lang


lang


Question 16. Which of these is a wrapper for data type int?
  1.    Integer
  2.    Long
  3.    Byte
  4.    Both a & b
 Discuss Question
Answer: Option A. -> Integer


Integer


Question 17. Which of these methods is used to check for infinitely large and small values?
  1.    isInfinite()
  2.    isNaN()
  3.    Isinfinite()
  4.    IsNaN()
 Discuss Question
Answer: Option A. -> isInfinite()


isinfinite() method returns true is the value being tested is infinitely large or small in magnitude.


Question 18. Which of these is a super class of wrappers Long, Character & Integer?
  1.    Long
  2.    Digits
  3.    Float
  4.    Number
 Discuss Question
Answer: Option D. -> Number


Number is an abstract class containing subclasses Double, Float, Byte, Short, Integer and Long.


Question 19. Which of the following methods is a method of wrapper Integer for obtaining hash code for the invoking object?
  1.    int hash()
  2.    int hashcode()
  3.    int hashCode()
  4.    Integer hashcode()
 Discuss Question
Answer: Option C. -> int hashCode()


int hashCode()


Latest Videos

Latest Test Papers