Java Programming Fundamentals

This test covers Java programming concepts including OOP, collections, serialization, garbage collection, and database connectivity with JDBC.

18 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

What is the role of encapsulation in Object Oriented Programming?

  1. It is used to hide the data from the outside view.
  2. By using encapsulation we can use the properties of the base class in the subclass.
  3. Encapsulation binds the data and code in a well defined interface.
  4. All of the above
  5. Both (1) and (3)
Question 2 Multiple Choice (Single Answer)

Which of the following statement(s) is/are true?

  1. A class can implement any number of the interfaces in java.
  2. A class can extends more than one abstract class in java.
  3. All the methods in an interface are abstract methods.
  4. All of the above
  5. Both (1) and (3)
Question 3 Multiple Choice (Single Answer)

Which of the following interface of JDBC (Java Database Connectivity) can not accept parameters?

  1. CallableStatement
  2. PreparedStatement
  3. Statement
  4. Both (2) and (3)
  5. None of the above
Question 4 Multiple Choice (Single Answer)

Which of the following design pattern comes under the creational design pattern category in java?

  1. Adapter
  2. Singleton
  3. Fecade
  4. Observer
  5. None of the above
Question 5 Multiple Choice (Single Answer)

What does Nan() function in java script?

  1. This function is used to determine that the value of the variable is not a string.
  2. This function is used to determine that the value of the variable is not a number.
  3. This function is used to determine that the value of the variable is not a boolean.
  4. None of the above
  5. There is no such function in java script.
Question 6 Multiple Choice (Single Answer)

What 'savepoint' command does in the SQL transaction?

  1. This command is used to mark the current point in the transaction when the transaction is in the process.
  2. This command is used to make the database changes permanent during the transaction.
  3. This command is used to undo the database changes in the transaction.
  4. This command can be used to rollback the part of the transaction.
  5. Both (1) and (4) are true
Question 7 Multiple Choice (Single Answer)

Which of the following interface allows duplicate elements or keys by their subclasses in collection in java?

  1. List
  2. SortedMap
  3. Set
  4. Map
  5. None of the above
Question 8 Multiple Choice (Single Answer)

Which of the following is/are the properties of Hashtable in collection in java?

  1. It is used to store and retrieve the value using the specified key.
  2. Hashtable is synchronized.
  3. It does not allow null keys or values.
  4. All of the above
  5. Only (1) and (2)
Question 9 Multiple Choice (Single Answer)

Which of the following statement(s) is/are not true?

  1. A TreeSet class maintains the ascending order of the elements.
  2. ArrayList class provides random access of the elements.
  3. ArrayList is not synchronized.
  4. HashMap class can not have any null key.
  5. None of the above
Question 10 Multiple Choice (Single Answer)

Which of the following is not true about TreeMap class in java?

  1. It sorts the element in ascending order.
  2. It can have null key.
  3. It can not have any null keys.
  4. It extends AbstractMap class.
  5. None of the above
Question 11 Multiple Choice (Single Answer)

Which of the following statement is not true about Applet in java?

  1. An applet can contain main method.
  2. The code of the applet can be downloaded in a user's browser if the html page contain that applet.
  3. The Graphics class is used to display the output of the applet.
  4. An applet can be used to fetch an image.
  5. None of the above
Question 12 Multiple Choice (Single Answer)

Which of the following is false about vector class in java collection framework?

  1. Vector is not synchronized.
  2. Vector can be resized the array as needed.
  3. Vector gives costlier performance as compared to ArrayList.
  4. Vector is also called dynamic array.
  5. None of the above
Question 13 Multiple Choice (Single Answer)

Which of the following is a false statement?

  1. A constructor can not be inherited by the subclass.
  2. A final method can not be override in the subclass.
  3. A constructor can be declared final.
  4. A final class can not be extended.
  5. None of the above
Question 14 Multiple Choice (Single Answer)

Which of the following property in css (cascading style sheet) is used to control the scrolling of an image in the background?

  1. Background-attachment
  2. Background-position
  3. Background-repeat
  4. Background-image
  5. None of the above.
Question 15 Multiple Choice (Single Answer)

Which of the following is/are true about serialization in java?

  1. By using serialization process, the state of the variable can be represented as a sequence of bytes.
  2. Serialization is a platform independent process.
  3. ObjectInputStream class is used to serialize or deserialize the object.
  4. All of the above are true
  5. Only (1) and (3) are true
Question 16 Multiple Choice (Single Answer)

Which of the following statement(s) is/are true?

  1. StringBuffer is a mutable class.
  2. StringBuilder is faster than StringBuffer.
  3. StringBuilder is a mutable class.
  4. All of the above are true
  5. None of the above
Question 17 Multiple Choice (Single Answer)

Which of the following is/are true about garbage collection in java?

  1. We can not force garbage collection mechanism in java.
  2. JVM uses finalize() method before destroy the unused objects.
  3. JVM uses system.gc() method to collect the unused memory objects.
  4. All the above are true
  5. Option (1) and (2) only
Question 18 Multiple Choice (Single Answer)

Which of the following is not a reserve word in java?

  1. Volatile
  2. Assert
  3. New
  4. Native
  5. None of the above