Online Exam Quiz

questionQuestion  1 to 30

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 classes is not a member class of java.io package?

  • File
  • String
  • Writer
  • Reader
Mark for review

Which of these is a mechanism for naming and visibility control of a class and its content?

  • Object
  • Packages
  • Interfaces
  • None of the above
Mark for review

Which of the following is a valid declaration of a char?

  • char ch = '\utea';
  • char ch = '\uTEA';
  • char ch = '\utea';
  • All of the above
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 extract a single character from a String object?

  • CHARAT()
  • charat()
  • charAt()
  • CharAt()
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 is not a member of java.lang.String class?

  • replace()
  • compareTo()
  • equals()
  • toString()
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

What is the use of the final keyword in Java?

  • To mark a class as not extendable
  • To mark a method as not overridable
  • To mark a variable as constant
  • All of the above
Mark for review

What is the extension of compiled java classes?

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

Which of the following is true about the anonymous inner class?

  • It has only methods
  • Objects can't be created
  • It has a fixed class name
  • It has no class name
Mark for review

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

  • InputStream
  • ObjectInputStream
  • Reader
  • InputStreamReader
Mark for review

In which package is the JDBC API included?

  • javax.swing
  • java.net
  • java.sql
  • java.util
Mark for review

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

  • JVM
  • JRE
  • JDK
  • JDB
Mark for review

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

  • int
  • float
  • double
  • long
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 the following classes provides methods to manipulate the size of arrays?

  • ArrayList
  • Arrays
  • Collections
  • Vector
Mark for review

Which of these operators is used to refer to the current instance of a method or a constructor?

  • this
  • super
  • extern
  • this()
Mark for review

What is the use of the synchronized keyword in Java?

  • To serialize a class
  • To prevent thread interference
  • To prevent method overriding
  • To create a constant variable
Mark for review

What does the 'super' keyword in Java do?

  • Refers to the current object
  • Refers to the parent class object
  • Refers to a static method
  • Refers to a private method
Mark for review

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

  • Make the class final
  • Make all fields private
  • Provide only getter methods
  • All of the above
Mark for review

Which exception is thrown when a division by zero occurs in Java?

  • ArithmeticException
  • NumberFormatException
  • NullPointerException
  • ClassCastException
Mark for review

What is the main purpose of the Java ClassLoader?

  • To load classes at runtime
  • To compile Java code
  • To execute bytecode
  • To interpret Java code
Mark for review

Which method in the Servlet interface is called once to initialize the servlet?

  • init()
  • start()
  • initServlet()
  • service()
Mark for review

Which of the following is not a valid Java keyword?

  • transient
  • volatile
  • const
  • synchronized
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 a valid declaration of a char in Java?

  • char ch = 'A';
  • char ch = "A";
  • char ch = A;
  • char ch = 'A"';
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

What is the default value of the local variables?

  • 0
  • null
  • FALSE
  • No default value
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