Java and Hibernate Programming Quiz

Test your knowledge of Java programming fundamentals, object-oriented concepts, and Hibernate ORM framework configuration

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Find the true statements, A. Final class cant be inherited. B. Abstract class cant be instantiated. C. Abstract class can be inherited.

  1. Only A & B
  2. Only B & C
  3. Only A & C
  4. A,B and C
Question 2 Multiple Choice (Single Answer)

In Object Oriented Programming, the concept of IS-A is based on which of the following?

  1. Inheritance
  2. Polymorphism
  3. Abstraction
  4. Modularization
Question 3 Multiple Choice (Single Answer)

Which of the following are mandatory when writing a POJO class?

  1. Implement a no-argument constructor
  2. provide an identifier property
  3. declare accessors for persistent fields
  4. all the above
Question 4 Multiple Choice (Single Answer)

The default_entity_mode is set to which mode by default?

  1. dynamic-map
  2. dom4j
  3. pojo
  4. None of the above
Question 5 Multiple Choice (Single Answer)

Which of the following attribute of the tag needs to be defined in the mapping xml when the default-entity mode is set to "dynamic-map"

  1. name
  2. entity-name
  3. node
  4. schema
Question 6 Multiple Choice (Single Answer)

What does the attribute "batch-size" of the tag specify?

  1. batch size for fetching instances
  2. batch size for fetching instances by identifier
  3. both
  4. none
Question 7 True/False

For the column name EMP_NAME in table EMP, the column mapping is described as below in the hbm xml. . Is this valid?

  1. True
  2. False
Question 8 Multiple Choice (Single Answer)

What are the different methods of Hibernate Configuration?

  1. Programmatic configuration
  2. using hibernate.properties configuration file
  3. using hibernate.cfg.xml
  4. all the above
Question 9 Multiple Choice (Single Answer)

Which tag in hibernate.cfg.xml is used to add a resource hbm xml for the current session factory instance?

  1. <hibernate-configuration>
  2. <session-factory>
  3. <mapping>
  4. <property>
Question 10 Multiple Choice (Single Answer)

What are the different approaches to represent an inheritance hierarchy?

  1. Table per Concrete class
  2. Table per Sub class
  3. Table per class Hierarchy
  4. all of the above
Question 11 True/False

All the bitwise operators have the same level of operator precedence in Java

  1. True
  2. False
Question 12 True/False

Two methods cannot have the same in Java

  1. True
  2. False
Question 13 True/False

Subclasses of an abstract class that do not provide an implementation of an abstract method are also abstract

  1. True
  2. False
Question 14 True/False

A Constructor must always invoke its super class constructors in its first statement

  1. True
  2. False
Question 15 True/False

An Array can store many different types of values

  1. True
  2. False
Question 16 True/False

when present,package must be the first noncomment statement in the file

  1. True
  2. False
Question 17 True/False

Objects are passed to a method by use of call-by-reference

  1. True
  2. False
Question 18 True/False

When we implement an interface method,it should be declared as Public

  1. True
  2. False
Question 19 True/False

Any class may be inherited by another class in the same package

  1. True
  2. False
Question 20 True/False

Every method of a final class is implicitly final

  1. True
  2. False