Online Exam Quiz

questionQuestion  1 to 30

What is the superclass of all classes in Java?

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

Which of the following is used to create a package in Java?

  • package
  • import
  • include
  • namespace
Mark for review

Which of the following is not a type of constructor in Java?

  • Default constructor
  • No-arg constructor
  • Parameterized constructor
  • Copy constructor
Mark for review

Which of the following is not a wrapper class in Java?

  • Integer
  • Double
  • Character
  • int
Mark for review

Which of the following statements is true about Java?

  • Java is a platform-independent language
  • Java is a procedural language
  • Java is a pure object-oriented language
  • Java supports both procedural and object-oriented programming
Mark for review

Which of the following is not a valid method of the PriorityQueue class in Java?

  • add()
  • remove()
  • size()
  • length()
Mark for review

Which of the following is not a valid method of the ArrayList class in Java?

  • add()
  • remove()
  • size()
  • length()
Mark for review

Which of the following is not a state of a thread?

  • New
  • Runnable
  • Blocked
  • Running
Mark for review

Which method is used to compare two strings in Java?

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

Which of the following is not a Java keyword?

  • static
  • Boolean
  • void
  • private
Mark for review

Which is a valid declaration of a char?

  • char ch = '\utea';
  • char ch = '\uface';
  • char ch = 'face';
  • char ch = 'afe';
Mark for review

What does the 'static' keyword mean in Java?

  • The variable or method is specific to an instance of a class
  • The variable or method is specific to the class
  • The variable or method can be accessed anywhere
  • None of the above
Mark for review

Which of the following is used to create an array in Java?

  • new
  • create
  • array
  • instance
Mark for review

Which of these is a mechanism for cleaning the internal state of an object before it is removed from memory?

  • finalize()
  • delete()
  • destructor()
  • remove()
Mark for review

Which of the following is used to create an object in Java?

  • new
  • create
  • object
  • instance
Mark for review

What is the extension of compiled Java classes?

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

Which of the following is used to create a volatile variable in Java?

  • volatile
  • variable
  • var
  • volatileVar
Mark for review

Which of the following is not a valid keyword in Java?

  • static
  • void
  • private
  • constant
Mark for review

Which keyword is used to inherit a class in Java?

  • extends
  • implements
  • inherits
  • super
Mark for review

Which of the following is not a valid method of the LinkedHashMap class in Java?

  • put()
  • get()
  • size()
  • length()
Mark for review

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

  • int
  • float
  • double
  • real
Mark for review

Which of the following is used to read data from a file in Java?

  • FileReader
  • FileWriter
  • FileInputStream
  • FileOutputStream
Mark for review

Which of the following is not a valid method of the TreeSet class in Java?

  • add()
  • remove()
  • size()
  • length()
Mark for review

Which of the following is used to stop a thread in Java?

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

Which of the following is true about Java?

  • Java is platform-independent
  • Java is a procedural language
  • Java does not support multithreading
  • Java is not object-oriented
Mark for review

What is the default value of the boolean data type in Java?

  • TRUE
  • FALSE
  • 0
  • null
Mark for review

Which of the following is not a method of the String class in Java?

  • length()
  • charAt()
  • append()
  • substring()
Mark for review

Which of the following is not a wrapper class in Java?

  • Integer
  • Float
  • Character
  • String
Mark for review

In Java, what is the correct syntax to output "Hello World"?

  • System.out.println("Hello World");
  • print("Hello World");
  • echo("Hello World");
  • Console.WriteLine("Hello World");
Mark for review

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

  • class
  • package
  • interface
  • implements
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