Online Exam Quiz

questionQuestion  1 to 30

What is the implicit return type of constructor?

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

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

  • String s1 = null;
  • String s2 = "null";
  • String s3 = (String) "abc";
  • String s4 = 'abc';
Mark for review

Which of these is a marker interface?

  • Runnable
  • Serializable
  • Comparable
  • Cloneable
Mark for review

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

  • JVM
  • JRE
  • JDK
  • JDB
Mark for review

What is the extension of compiled Java classes?

  • .txt
  • .class
  • .js
  • .java
Mark for review

Which package is automatically imported into every Java program?

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

Which method is used to write characters to a file in Java?

  • write()
  • writeChars()
  • print()
  • println()
Mark for review

Which of these can be used to create a thread in Java?

  • Extending the Runnable interface
  • Implementing the Thread class
  • Both a and b
  • Neither a nor b
Mark for review

What is the result of the expression 13 & 25?

  • 38
  • 25
  • 8
  • 16
Mark for review

Which exception is thrown when an array is accessed with an illegal index?

  • ArrayIndexException
  • ArrayException
  • ArrayStoreException
  • ArrayIndexOutOfBoundsException
Mark for review

Which of these classes are synchronized?

  • ArrayList
  • Vector
  • HashMap
  • HashSet
Mark for review

What is the size of int data type in Java?

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

What is the base class for all classes in Java?

  • java.lang.String
  • java.lang.System
  • java.lang.Runtime
  • java.lang.Object
Mark for review

Which of these methods is used to remove all elements from a collection?

  • clear()
  • removeAll()
  • delete()
  • deleteAll()
Mark for review

Which method is used to read a single character in Java?

  • read()
  • readChar()
  • readLine()
  • readCharacter()
Mark for review

What is the use of the 'this' keyword in Java?

  • To refer to the current object
  • To refer to the parent class object
  • To refer to the child class object
  • To refer to the object of the same class
Mark for review

Which of these classes is used to generate random numbers in Java?

  • Random
  • RandomGenerator
  • RandomGen
  • Randomize
Mark for review

Which of these is an interface in Java?

  • Runnable
  • RunnableThread
  • SerializableThread
  • SerializableRun
Mark for review

Which of the following is not a Java feature?

  • Dynamic
  • Architecture Neutral
  • Use of pointers
  • Object-oriented
Mark for review

What is the return type of the hashCode() method in Java?

  • int
  • float
  • void
  • long
Mark for review

Which of the following is true about Java?

  • Java is a platform-independent language
  • Java is a language dependent on a platform
  • Java is a procedure-oriented language
  • Java does not support OOPS concept
Mark for review

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

  • main()
  • abstract()
  • run()
  • None of the mentioned
Mark for review

Which of these is not a type of inheritance in Java?

  • Single inheritance
  • Multiple inheritance
  • Multilevel inheritance
  • Hierarchical inheritance
Mark for review

Which of these keywords is used to define an abstract class in Java?

  • abstract
  • final
  • static
  • volatile
Mark for review

Which keyword is used to prevent inheritance of a class in Java?

  • final
  • finally
  • finalize
  • static
Mark for review

Which of these classes is used to read character data in Java?

  • FileInputStream
  • FileOutputStream
  • FileReader
  • FileWriter
Mark for review

Which of these keywords is used to handle exceptions in Java?

  • try
  • catch
  • finally
  • all of the mentioned
Mark for review

Which of the following cannot be stored in a Collection?

  • Objects
  • Primitive data types
  • Arrays
  • User-defined classes
Mark for review

Which method is the entry point of a Java program?

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

Which of these is not a valid identifier in Java?

  • _abc
  • $abc
  • abc123
  • 123abc
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