Online Exam Quiz

questionQuestion  1 to 30

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 cannot be used for a variable name in Java?

  • identifier
  • keyword
  • variable
  • constant
Mark for review

Which of the following is a marker interface?

  • Serializable
  • Runnable
  • Remote
  • Result
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

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

  • TRUE
  • FALSE
  • 0
  • 1
Mark for review

Which of the following is a reserved keyword in Java?

  • object
  • strictfp
  • system
  • main
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 the following is not a primitive data type?

  • Byte
  • String
  • Integer
  • Float
Mark for review

Which of the following is not a Java statement?

  • for
  • while
  • continue
  • return
Mark for review

Which exception is thrown when divide by zero statement executes?

  • NullPointerException
  • ArithmeticException
  • ArrayIndexOutOfBoundsException
  • NumberFormatException
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 default value of an instance variable?

  • null
  • 0
  • depends on the data type
  • depends on the class
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 a reserved keyword in Java?

  • null
  • TRUE
  • goto
  • constant
Mark for review

Which keyword is used to create a new object?

  • malloc
  • alloc
  • new
  • create
Mark for review

Which method must be implemented by all threads?

  • run()
  • start()
  • stop()
  • main()
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

Which of the following is not a Java keyword?

  • class
  • interface
  • extends
  • pointer
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 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 method must be implemented by all threads?

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

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

  • char ch = 65;
  • char ch = 'A';
  • char ch = '\u0061';
  • char ch = 'A B';
Mark for review

Which method of the class String is used to obtain length of String object?

  • get()
  • Sizeof()
  • lengthof()
  • length()
Mark for review

Which of these is a superclass of all exception classes?

  • Error
  • Throwable
  • RuntimeException
  • Exception
Mark for review

Which of the following is not an OOP concept in Java?

  • Inheritance
  • Encapsulation
  • Polymorphism
  • Compilation
Mark for review

Which keyword is used to refer to the current object?

  • this
  • super
  • self
  • current
Mark for review

What is the implicit return type of the constructor?

  • void
  • int
  • float
  • None of the mentioned
Mark for review

Which of these classes are thread-safe in Java?

  • Vector
  • ArrayList
  • LinkedList
  • None of the above
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 use of the "instanceof" keyword?

  • Compare two objects
  • Check if object is of a particular class
  • Typecast object
  • None of the mentioned
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