Online Exam Quiz

questionQuestion  1 to 30

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

  • identifier
  • keyword
  • letter
  • underscore
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 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

What is the size of int variable in Java?

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

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

  • protected
  • private
  • public
  • transient
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 default value of a local variable?

  • null
  • 0
  • depends on the data type
  • no default value
Mark for review

Which of the following is a marker interface?

  • Runnable
  • Remote
  • Readable
  • Result
Mark for review

Which of these are valid identifiers?

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

Which of the following is a reserved keyword in Java?

  • null
  • TRUE
  • goto
  • constant
Mark for review

Which of these packages contains the exception classes?

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

Which of the following is a valid long literal?

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

Which of these keywords is used to define interfaces in Java?

  • interface
  • Interface
  • intf
  • Intf
Mark for review

Which keyword is used to create an interface in Java?

  • class
  • interface
  • extends
  • implements
Mark for review

Which of the following is a superclass of every class in Java?

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

Which method must be implemented by all threads?

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

Which keyword is used to refer to the current object?

  • this
  • super
  • self
  • current
Mark for review

Which of these packages contains the exception StackOverflowError?

  • java.io
  • java.system
  • java.lang
  • java.util
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 of these methods is used to print an object in Java?

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

Which of these operators is used to allocate memory to an array variable in Java?

  • malloc
  • alloc
  • new
  • new malloc
Mark for review

What is the output of: System.out.println(2 + "2");

  • 4
  • 22
  • "4"
  • "22"
Mark for review

What is the range of short data type in Java?

  • -128 to 127
  • -32768 to 32767
  • -2147483648 to 2147483647
  • None of the mentioned
Mark for review

What is the default value of the Boolean variable?

  • TRUE
  • FALSE
  • null
  • not defined
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 keyword is used for accessing the features of a package?

  • package
  • import
  • extends
  • implements
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 one is a template for creating different objects?

  • An array
  • A class
  • An interface
  • A method
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

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