Online Exam Quiz

questionQuestion  1 to 30

Which exception is thrown when a file is not found in Java?

  • FileNotFoundException
  • IOException
  • ClassNotFoundException
  • NullPointerException
Mark for review

Which of the following is not a valid Java keyword?

  • strictfp
  • constant
  • goto
  • native
Mark for review

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

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

Which of these methods can be used to make the main thread wait for all child threads to finish?

  • sleep()
  • isAlive()
  • join()
  • stop()
Mark for review

What is the default value of the local variables?

  • 0
  • null
  • FALSE
  • No default value
Mark for review

What does JVM stand for in Java?

  • Java Variable Model
  • Java Virtual Machine
  • Java Visual Model
  • Java Version Machine
Mark for review

Which of the following is not a valid type of inheritance in Java?

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

Which operator is considered to be with the highest precedence?

  • ()
  • =
  • ?:
  • ++
Mark for review

Which Java feature allows multiple methods with the same name but different parameters?

  • Method Overloading
  • Method Overriding
  • Encapsulation
  • Inheritance
Mark for review

Which of the following is not a Java feature?

  • Object-oriented
  • Use of pointers
  • Portable
  • Dynamic
Mark for review

Which of the following is not a valid Java keyword?

  • transient
  • volatile
  • const
  • synchronized
Mark for review

Which of the following is a checked exception?

  • NullPointerException
  • ClassCastException
  • IOException
  • ArrayIndexOutOfBoundsException
Mark for review

Which of these packages contains all the collection classes?

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

Which of the following is not a valid declaration within an interface?

  • public int method();
  • void method();
  • protected void method();
  • static int method();
Mark for review

Which of the following is true about a static method?

  • It can access instance variables
  • It can be overridden
  • It cannot be called from a static context
  • It can be called using the class name
Mark for review

What is the main purpose of the Java Compiler?

  • To run Java applications
  • To translate bytecode into machine code
  • To translate Java source code into bytecode
  • To interpret Java bytecode
Mark for review

Which of these keywords is used to define packages in Java?

  • pkg
  • Pkg
  • package
  • Package
Mark for review

Which of the following is true about the String class in Java?

  • Strings are mutable
  • Strings are immutable
  • Strings are of fixed length
  • Strings are primitive types
Mark for review

Which of the following is the correct way of importing an entire package ?pkg??

  • import pkg.*
  • Import pkg.*
  • import pkg.
  • Import pkg.
Mark for review

What is the return type of the main method in Java?

  • void
  • int
  • String
  • float
Mark for review

Which of the following classes provides methods to manipulate the size of arrays?

  • ArrayList
  • Arrays
  • Collections
  • Vector
Mark for review

Which of the following is a marker interface?

  • Serializable
  • Cloneable
  • Remote
  • All of the above
Mark for review

When a thread is created and started, what is its initial state?

  • Ready
  • Running
  • Waiting
  • Sleeping
Mark for review

Which of these standard collection classes implements a dynamic array?

  • ArrayList
  • LinkedList
  • HashSet
  • HashMap
Mark for review

Which of these methods is used to access members of a class in Java?

  • dot operator (.)
  • arrow operator (->)
  • star operator (*)
  • pointer operator (&)
Mark for review

Which of these classes are used by Byte streams for input and output operation?

  • InputStream
  • ObjectInputStream
  • Reader
  • InputStreamReader
Mark for review

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

  • identifier & keyword
  • identifier
  • keyword
  • None of the above
Mark for review

Which of the following is a core interface in Java Collections Framework?

  • ArrayList
  • HashMap
  • List
  • TreeMap
Mark for review

Which method is used to return the name of a thread?

  • getName()
  • getId()
  • getThread()
  • getThreadName()
Mark for review

Which of these methods form the interface of Runnable?

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