Online Exam Quiz

questionQuestion  1 to 30

What is the size of an int variable in Java?

  • 4 bytes
  • 2 bytes
  • 8 bytes
  • 16 bytes
Mark for review

What does the expression 1.0 / 0.0 evaluate to in Java?

  • 0
  • NaN
  • Infinity
  • Runtime Exception
Mark for review

What is the default value of a boolean variable in Java?

  • TRUE
  • FALSE
  • 0
  • 1
Mark for review

Which of these methods is a part of the Object class?

  • notify(), wait(), sleep()
  • notify(), wait(), clone()
  • sleep(), wait(), notifyAll()
  • sleep(), wait(), getObject()
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 operator is used by Java for string concatenation?

  • +
  • -
  • *
  • &
Mark for review

Which of these is a mechanism for naming and visibility control of a class and its content?

  • Object
  • Package
  • Interfaces
  • None of the mentioned
Mark for review

Which of the following is not a Java features?

  • Dynamic
  • Architecture Neutral
  • Use of pointers
  • Object-oriented
Mark for review

Which of the following is a reserved keyword in Java?

  • object
  • strictfp
  • system
  • main
Mark for review

What is the size of int variable in Java?

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

Which method is used to terminate a thread?

  • terminate()
  • end()
  • stop()
  • finish()
Mark for review

Which method must be implemented by all threads?

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

Which exception is thrown when java is out of memory?

  • MemoryError
  • OutOfMemoryError
  • MemoryOutOfBoundsException
  • MemoryFullException
Mark for review

What is the default value of an instance variable?

  • null
  • 0
  • depends on the type of variable
  • default values are same as local variables
Mark for review

Which keyword is used to refer to the current object?

  • this
  • super
  • self
  • current
Mark for review

How many times can a constructor be called during the lifetime of the object?

  • As many times as necessary
  • Only once
  • Depends on the type of class
  • At least once
Mark for review

Which method is used to schedule a thread for execution?

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

Which of these classes is not part of Java's collection framework?

  • ArrayList
  • LinkedList
  • HashSet
  • Hashtable
Mark for review

Which keyword is used for inheritance in Java?

  • inherit
  • extends
  • implements
  • inherits
Mark for review

Which method is the starting point for all Java programs?

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

Which keyword is used to declare a constant in Java?

  • const
  • final
  • static
  • constant
Mark for review

What is synchronization in reference to a thread?

  • It?s a process of handling situations when two or more threads need access to a shared resource.
  • It?s a process by which many threads are able to access same shared resource simultaneously.
  • It?s a method that allows threads to communicate with each other.
  • It?s a method of coordinating access to a shared resource.
Mark for review

Which of these are valid identifiers?

  • _var
  • $var
  • var
  • All of the mentioned
Mark for review

What is the default value of a float variable?

  • 0.0d
  • 0.0f
  • 0
  • 0
Mark for review

Which of the following is a valid long literal?

  • 0xnf024L
  • ABH8097
  • L990023
  • 904423
Mark for review

Which of the following is not a valid way to create an array in Java?

  • int[] arr = new int[5];
  • int[] arr = {1, 2, 3, 4, 5};
  • int arr[] = new int[5];
  • int arr() = new int[5];
Mark for review

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

  • protected
  • private
  • public
  • transient
Mark for review

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

  • identifier
  • keyword
  • variable
  • constant
Mark for review

Which class is the superclass of every class in Java?

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

Which of the following is not an access modifier?

  • public
  • protected
  • void
  • private
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