• ( 2 ) All the wrapper class (Integer, Boolean, Float, Short, Long, Double and Character) in java

    • 1) are private
    • 2) are serializable
    • 3) are immutable
    • 4) are finale
    • Discussion in forum
      Answer : 4) are finale
      Solution :








      discussion


      Answer : 4) are finale

    • ( 3 ) super keyword can be used to _____

    • 1) call super class's constructor
    • 2) access super class 's member
    • 3) Both 1 & 2
    • 4) None of these
    • Discussion in forum
      Answer : 3) Both 1 & 2
      Solution :








      discussion


      Answer : 3) Both 1 & 2

    • ( 4 ) What is a class in java?

    • 1) A class is a blue print from which individual objects are created. A class can contain fields and methods to describe the behavior of an object.
    • 2) class is a special data type.
    • 3) class is used to allocate memory to a data type
    • 4) None of these
    • Discussion in forum
      Answer : 1) A class is a blue print from which individual objects are created. A class can contain fields and methods to describe the behavior of an object.
      Solution :








      discussion


      Answer : 1) A class is a blue print from which individual objects are created. A class can contain fields and methods to describe the behavior of an object.

    • ( 5 ) Which of these cannot be declared static?

    • 1) class
    • 2) object
    • 3) variable
    • 4) method
    • Discussion in forum
      Answer : 2) object
      Solution : static statements are run as soon as class containing then is loaded, prior to any object declaration.








      discussion


      Answer : 2) object

    • ( 6 ) Which of these keywords can be used to prevent inheritance of a class?

    • 1) super
    • 2) constant
    • 3) Class
    • 4) final
    • Discussion in forum
      Answer : 4) final
      Solution : Declaring a class final implicitly declares all of its methods final, and makes the class inheritable.








      discussion


      Answer : 4) final

    • ( 7 ) Which statement is true about a static nested class?

    • 1) It does not have access to nonstatic members of the enclosing class.
    • 2) It must extend the enclosing class.
    • 3) You must have a reference to an instance of the enclosing class in order to instantiate it.
    • 4) It's variables and methods must be static.
    • Discussion in forum
      Answer : 1) It does not have access to nonstatic members of the enclosing class.
      Solution :








      discussion


      Answer : 1) It does not have access to nonstatic members of the enclosing class.

    • ( 8 ) You want subclasses in any package to have access to members of a superclass. Which is the most restrictive access that accomplishes this objective?

    • 1) public
    • 2) Protected
    • 3) private
    • 4) transient
    • Discussion in forum
      Answer : 2) Protected
      Solution :








      discussion


      Answer : 2) Protected

    • ( 9 ) Which of these are integer constants defined in ActionEvent class?

    • 1) ALT_MASK
    • 2) CTRL_MASK
    • 3) SHIFT_MASK
    • 4) All of the above
    • Discussion in forum
      Answer : 4) All of the above
      Solution :








      discussion


      Answer : 4) All of the above

    • ( 10 ) When a class is declared as final , then ____

    • 1) It can not be inherited
    • 2) It must be inherited
    • 3) Its object can not be created
    • 4) None of these
    • Discussion in forum
      Answer : 1) It can not be inherited
      Solution :








      discussion


      Answer : 1) It can not be inherited





Top