Online Exam Quiz

questionQuestion  1 to 30

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

Which of these statements is correct about interfaces in Java?

  • An interface can have only abstract methods.
  • An interface can have concrete methods.
  • Interfaces cannot be instantiated.
  • All of the mentioned
Mark for review

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

  • TRUE
  • FALSE
  • 0
  • 1
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 exception is thrown when java is out of memory?

  • MemoryError
  • OutOfMemoryError
  • MemoryOutOfBoundsException
  • MemoryFullException
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 StackOverflowError?

  • java.lang
  • java.util
  • java.io
  • java.system
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 to create a new object?

  • malloc
  • alloc
  • new
  • create
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 method of the String class is used to compare two String objects for their equality?

  • equals()
  • compare()
  • equalsIgnoreCase()
  • compareTo()
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 of the following is not a Java statement?

  • for
  • while
  • continue
  • return
Mark for review

Which of the following is not a keyword in Java?

  • static
  • Boolean
  • void
  • private
Mark for review

What is the size of an int variable in Java?

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

Which operator is used by Java for string concatenation?

  • +
  • -
  • *
  • &
Mark for review

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

  • identifier
  • keyword
  • letter
  • underscore
Mark for review

Which one is a template for creating different objects?

  • An array
  • A class
  • An interface
  • A method
Mark for review

Which method is used to terminate a thread?

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

Which keyword is used for inheritance in Java?

  • inherit
  • extends
  • implements
  • inherits
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

Which method must be implemented by all threads?

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

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

  • identifier
  • keyword
  • variable
  • constant
Mark for review

Which of the following is used to create an object in Java?

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

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

  • run()
  • start()
  • stop()
  • All of the above
Mark for review

What is the extension of compiled Java classes?

  • .js
  • .txt
  • .class
  • .java
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 not a type of constructor in Java?

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

Which keyword is used to declare a constant in Java?

  • const
  • final
  • static
  • constant
Mark for review

Which of the following is used to find and fix bugs in Java programs?

  • JVM
  • JRE
  • JDK
  • JDB
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