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 of these are selection statements in Java?

  • break, continue
  • for, do, while
  • if, switch
  • try, catch
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 these is returned by the operator '&'?

  • Character
  • Integer
  • Boolean
  • Float
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

What is the size of int variable in Java?

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

What is the implicit return type of the constructor?

  • void
  • int
  • float
  • None of the mentioned
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 these methods is used to read a string from the input stream?

  • get()
  • getLine()
  • read()
  • readLine()
Mark for review

Which method is used to schedule a thread for execution?

  • run()
  • start()
  • resume()
  • yield()
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 keyword is used for accessing the features of a package?

  • package
  • import
  • extends
  • implements
Mark for review

Which of the following is not a primitive data type?

  • Byte
  • String
  • Integer
  • Float
Mark for review

What is the default value of a float variable?

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

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

  • identifier
  • keyword
  • variable
  • constant
Mark for review

Which operator is used by Java for string concatenation?

  • +
  • -
  • *
  • &
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

Which of these is not a wrapper class?

  • Integer
  • String
  • Byte
  • Double
Mark for review

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

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

Which of the following is not an access modifier?

  • public
  • protected
  • void
  • private
Mark for review

Which of the following option leads to the portability and security of Java?

  • Bytecode is executed by JVM
  • The applet makes the Java code secure
  • Use of exception handling
  • Dynamic binding between objects
Mark for review

Which of the following is a marker interface?

  • Serializable
  • Runnable
  • Remote
  • Result
Mark for review

Which of the following is not a Java feature?

  • Object-oriented
  • Use of pointers
  • Portable
  • Dynamic and Extensible
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 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

In which memory a String is stored, when we create a string using new operator?

  • Stack
  • String memory
  • Heap
  • Random memory
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 these keywords is used to define interfaces in Java?

  • interface
  • Interface
  • intf
  • Intf
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 the local variables?

  • null
  • 0
  • depends on the type of variable
  • No default value for local variables
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