Online Exam Quiz

questionQuestion  1 to 30

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

  • malloc
  • alloc
  • new
  • new malloc
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 an instance variable?

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

Which method is the starting point for all Java programs?

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

Which exception is thrown when java is out of memory?

  • MemoryError
  • OutOfMemoryError
  • MemoryOutOfBoundsException
  • MemoryFullException
Mark for review

What is the implicit return type of constructor?

  • no return type
  • void
  • int
  • float
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 method is used to schedule a thread for execution?

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

Which of these is a superclass of all exception classes?

  • Error
  • Throwable
  • RuntimeException
  • Exception
Mark for review

Which method can be defined only once in a program?

  • main method
  • finalize method
  • static method
  • private method
Mark for review

Which operator is used to test if a particular property exists or not?

  • in
  • instanceof
  • typeof
  • None of the mentioned
Mark for review

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

  • identifier
  • keyword
  • variable
  • constant
Mark for review

Which of these is returned by the operator '&'?

  • Character
  • Integer
  • Boolean
  • Float
Mark for review

Which of these methods is used to read a string from the input stream?

  • get()
  • getLine()
  • read()
  • readLine()
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 the following is used to find and fix bugs in Java programs?

  • JVM
  • JRE
  • JDK
  • JDB
Mark for review

Which keyword is used to define an abstract class?

  • abstract
  • Abstract
  • final
  • static
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 an instance variable?

  • null
  • 0
  • depends on the data type
  • depends on the class
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 keyword is used to create an interface in Java?

  • class
  • interface
  • extends
  • implements
Mark for review

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

  • identifier
  • keyword
  • letter
  • underscore
Mark for review

Which method is used to terminate a thread?

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

Which of the following is a marker interface?

  • Runnable
  • Remote
  • Readable
  • Result
Mark for review

Which keyword is used for inheritance in Java?

  • inherit
  • extends
  • implements
  • inherits
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 output of: System.out.println(2 + "2");

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

Which of these methods is not defined in the Math class?

  • min()
  • max()
  • abs()
  • getExponent()
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 is the entry point for a Java application?

  • main
  • start
  • init
  • run
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