Online Exam Quiz

questionQuestion  1 to 30

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 used to declare a constant in Java?

  • const
  • final
  • static
  • constant
Mark for review

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

  • Intent
  • Activity
  • Services
  • Action
Mark for review

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

  • int
  • float
  • boolean
  • String
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 of these methods is a part of the Object class in Java?

  • toString()
  • equals()
  • hashCode()
  • All of the above
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 methods is used to find the length of a string in Java?

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

What is the default encoding for an InputStreamReader?

  • UTF-8
  • ASCII
  • ISO-8859-1
  • UTF-16
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 valid method of the LinkedHashMap class in Java?

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

Which of these operators is used to allocate memory to array variables in Java?

  • malloc
  • alloc
  • new
  • calloc
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

Which method is used to compare two strings in Java?

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

Which method is used to write bytes to an output stream?

  • read()
  • write()
  • print()
  • display()
Mark for review

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

  • int
  • float
  • double
  • real
Mark for review

Which method must be implemented by all threads?

  • run()
  • start()
  • stop()
  • wait()
Mark for review

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

  • static
  • method
  • function
  • procedure
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

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

  • Object
  • int
  • long
  • void
Mark for review

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

  • New
  • Runnable
  • Blocked
  • Running
Mark for review

Which is not a valid way to declare an array in Java?

  • int arr[] = new int[5];
  • int arr[] = {1, 2, 3, 4, 5};
  • int arr[];
  • int arr[5] = new int[];
Mark for review

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

  • byte b = 128;
  • byte b = 0;
  • byte b = -129;
  • byte b = 256;
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 valid method of the HashMap class in Java?

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

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

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

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

  • int
  • long
  • float
  • double
Mark for review

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

  • +
  • -
  • *
  • **
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

What is the size of int in Java?

  • 4 bytes
  • 2 bytes
  • 8 bytes
  • 1 byte
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