Home / CSE MCQs / JAVA MCQs :: java.lang Package

CSE MCQs :: JAVA MCQs

  1. Which of these is wrapper for simple data type char?
  2. A.
    Float
    B.
    Character
    C.
    String
    D.
    Both b & c

  3. Which of the following is method of wrapper Integer for converting the value of an object into byte?
  4. A.
    bytevalue()
    B.
    byte bytevalue()
    C.
    Bytevalue()
    D.
    Byte Bytevalue()

  5. Which of these methods is used to obtain value of invoking object as a long?
  6. A.
    long value()
    B.
    long longValue()
    C.
    Long longvalue()
    D.
    Long Longvalue()

  7. Which of these class have only one field 'TYPE'?
  8. A.
    Void
    B.
    Process
    C.
    System
    D.
    Runtime

  9. Which of the following method of Process class can terminate a process?
  10. A.
    void kill()
    B.
    void destroy()
    C.
    void terminate()
    D.
    void exit()

  11. Standard output variable 'out' is defined in which class?
  12. A.
    Void
    B.
    Process
    C.
    Runtime
    D.
    System

  13. Which of these class can encapsulate an entire executing program?
  14. A.
    Void
    B.
    Process
    C.
    Runtime
    D.
    System

  15. Which of the following is method of System class is used to find how long a program takes to execute?
  16. A.
    currenttime()
    B.
    currentTime()
    C.
    currentTimeMillis()
    D.
    currenttimeMillis()

  17. Which of these class holds a collection of static methods and variables?
  18. A.
    Void
    B.
    Process
    C.
    Runtime
    D.
    System