Online Exam Quiz

questionQuestion  1 to 30

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

  • read()
  • readChar()
  • readLine()
  • readCharacter()
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 method is the entry point of a Java program?

  • start()
  • main()
  • run()
  • init()
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 method is used to start a thread execution in Java?

  • init()
  • start()
  • run()
  • resume()
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 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

Which of these is a valid declaration of a char?

  • char ch = 'ab';
  • char ch = 'a';
  • char ch = 'a'';
  • char ch = a;
Mark for review

Which of these is a marker interface?

  • Runnable
  • Serializable
  • Comparable
  • Cloneable
Mark for review

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

  • Inheritance
  • Encapsulation
  • Polymorphism
  • Compilation
Mark for review

Which of these methods is used to compare two strings, ignoring case differences?

  • equals()
  • equalsIgnoreCase()
  • compare()
  • compareTo()
Mark for review

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

  • try
  • catch
  • finally
  • all of the mentioned
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 collection class allows you to grow or shrink its size and provides indexed access to its elements, but whose methods are not synchronized?

  • java.util.HashSet
  • java.util.LinkedHashSet
  • java.util.List
  • java.util.ArrayList
Mark for review

What is the default value of byte variable in Java?

  • 0
  • 0
  • null
  • undefined
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 methods is used to obtain an iterator for a collection?

  • iterator()
  • iterate()
  • listIterator()
  • list()
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 the following is not a Java feature?

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

Which of the following cannot be stored in a Collection?

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

What is the result of the expression 13 & 25?

  • 38
  • 25
  • 8
  • 16
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 valid identifier in Java?

  • _abc
  • $abc
  • abc123
  • 123abc
Mark for review

Which of these is an interface in Java?

  • Runnable
  • RunnableThread
  • SerializableThread
  • SerializableRun
Mark for review

Which method is called by the garbage collector in Java?

  • finalize()
  • final()
  • finally()
  • all of the mentioned
Mark for review

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

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

Which of these operators can be used to concatenate two or more String objects?

  • +
  • &
  • -
  • %
Mark for review

Which method is used to add elements to a collection?

  • add()
  • append()
  • insert()
  • push()
Mark for review

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

  • FileInputStream
  • FileOutputStream
  • FileReader
  • FileWriter
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