Online Exam Quiz

questionQuestion  1 to 30

Which method can be defined only once in a program?

  • main method
  • finalize method
  • static method
  • private method
Mark for review

Which keyword is used to refer to the current object?

  • this
  • super
  • self
  • current
Mark for review

Which of these cannot be used for a variable name in Java?

  • identifier
  • keyword
  • variable
  • constant
Mark for review

Which of these methods is used to print an object in Java?

  • print()
  • println()
  • printf()
  • all of the mentioned
Mark for review

Which of the following is not a feature of Java?

  • Object-oriented
  • Use of pointers
  • Portable
  • Dynamic
Mark for review

What is the size of a byte variable in Java?

  • 8 bits
  • 16 bits
  • 32 bits
  • 64 bits
Mark for review

What is the return type of the hashCode() method in the Object class?

  • int
  • Object
  • long
  • void
Mark for review

Which method is the entry point for a Java application?

  • main
  • start
  • init
  • run
Mark for review

Which of these methods is not defined in the Math class?

  • min()
  • max()
  • abs()
  • getExponent()
Mark for review

Which package contains the Random class?

  • java.util package
  • java.lang package
  • java.awt package
  • java.io package
Mark for review

Which of the following is a valid declaration of a char?

  • char ch = '\utea';
  • char ch = '\uface';
  • char ch = '\iface';
  • char ch = '\u002';
Mark for review

Which operator is used to test if a particular property exists or not?

  • in
  • instanceof
  • typeof
  • None of the mentioned
Mark for review

Which exception is thrown when java is out of memory?

  • MemoryError
  • OutOfMemoryError
  • MemoryOutOfBoundsException
  • MemoryFullException
Mark for review

Which of the following is a marker interface?

  • Runnable
  • Remote
  • Readable
  • Result
Mark for review

Which of the following is a reserved keyword in Java?

  • object
  • strictfp
  • system
  • main
Mark for review

Which of these is not a wrapper class?

  • Integer
  • String
  • Byte
  • Double
Mark for review

Which of the following is not a type of constructor in Java?

  • Default constructor
  • Parameterized constructor
  • Copy constructor
  • Friend constructor
Mark for review

Which of these classes are the direct subclasses of the Throwable class?

  • RuntimeException and Error
  • Exception and VirtualMachineError
  • Error and Exception
  • IOException and RuntimeException
Mark for review

Which of the following is true about the anonymous inner class?

  • It has only methods
  • Objects can't be created
  • It has a fixed class name
  • It has no class name
Mark for review

Which of these packages contains the exception classes?

  • java.lang
  • java.util
  • java.io
  • java.net
Mark for review

Which method must be implemented by all threads?

  • start()
  • run()
  • stop()
  • main()
Mark for review

What does the expression float a = 35 / 0 return?

  • 0
  • Not a Number
  • Infinity
  • Run time exception
Mark for review

Which of the following is not an access modifier in Java?

  • protected
  • private
  • public
  • transient
Mark for review

Which of the following is a marker interface?

  • Serializable
  • Runnable
  • Remote
  • Result
Mark for review

Which method can be defined only once in a program?

  • main method
  • finalize method
  • static method
  • private method
Mark for review

What is the default value of the local variables?

  • null
  • 0
  • depends on the type of variable
  • No default value for local variables
Mark for review

Which method is used to schedule a thread for execution?

  • run()
  • start()
  • resume()
  • yield()
Mark for review

Which of the following is not a Java keyword?

  • class
  • interface
  • extends
  • pointer
Mark for review

Which of the following is not a keyword in Java?

  • static
  • Boolean
  • void
  • private
Mark for review

Which class is the superclass of every class in Java?

  • ArrayList
  • Abstract class
  • Object
  • String
Mark for review

blinkerOnline

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • Answered
  • Not Answered
  • Marked for Review