Online Exam Quiz

questionQuestion  1 to 30

Which method can be defined only once in a program?

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

Which of the following is not a type of constructor?

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

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

  • put()
  • get()
  • size()
  • length()
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 operator in Java?

  • +
  • -
  • *
  • **
Mark for review

Which of the following is used to declare a constant in Java?

  • const
  • final
  • static
  • constant
Mark for review

Which of these is used to explain the type of exception that is thrown by a method?

  • throw
  • throws
  • thrown
  • exception
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 the following is not a primitive data type in Java?

  • int
  • float
  • boolean
  • String
Mark for review

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

  • new
  • create
  • array
  • instance
Mark for review

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 method is used to perform some action when an object is to be destroyed?

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

Which method can be used to find the length of a string in Java?

  • length()
  • size()
  • getSize()
  • getLength()
Mark for review

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

  • push()
  • pop()
  • size()
  • length()
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 used to create a transient variable in Java?

  • transient
  • variable
  • var
  • transientVar
Mark for review

Which of these is not a valid component of the Android architecture?

  • Intent
  • Activity
  • Services
  • Action
Mark for review

Which method must be implemented by all threads?

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

Which of these data types is used to store text in Java?

  • int
  • float
  • char
  • String
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 not a state of a thread?

  • New
  • Runnable
  • Blocked
  • Running
Mark for review

Which of these methods is a part of the Object class in Java?

  • toString()
  • equals()
  • hashCode()
  • All of the above
Mark for review

Which of the following is not a feature of Java?

  • Object-oriented
  • Use of pointers
  • Platform-independent
  • Robust
Mark for review

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

  • Runnable interface
  • Thread class
  • Both A and B
  • None of the above
Mark for review

Which is the valid declaration within an interface definition?

  • public double methoda();
  • public final double methoda();
  • static void methoda(double d1);
  • protected void methoda(double d1);
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 keyword is used for accessing the features of a package?

  • package
  • import
  • extends
  • implements
Mark for review

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

  • final
  • class
  • interface
  • extends
Mark for review

Which keyword is used to inherit a class in Java?

  • extends
  • implements
  • inherits
  • super
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