0

programming languages Online Quiz - 136

Description: programming languages Online Quiz - 136
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

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


Correct Option: A

The default_entity_mode is set to which mode by default?

  1. dynamic-map

  2. dom4j

  3. pojo

  4. None of the above


Correct Option: C

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


Correct Option: B

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


Correct Option: B

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


Correct Option: D

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


Correct Option: D

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

  1. True

  2. False


Correct Option: A

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

  1. True

  2. False


Correct Option: B

An Array can store many different types of values

  1. True

  2. False


Correct Option: B

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

  1. True

  2. False


Correct Option: A

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

  1. True

  2. False


Correct Option: A

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

  1. True

  2. False


Correct Option: B

AI Explanation

To answer this question, you need to understand the concept of inheritance in object-oriented programming.

Inheritance is a mechanism in object-oriented programming that allows a class to inherit properties and methods from another class. The class that inherits from another class is called the subclass or derived class, and the class being inherited from is called the superclass or base class.

In Java, when a class is declared with the default access modifier (no access modifier specified), it is only accessible within the same package. This means that only classes in the same package can inherit from it.

So, the statement "Any class may be inherited by another class in the same package" is incorrect. The correct answer is B) False.

Every method of a final class is implicitly final

  1. True

  2. False


Correct Option: A
- Hide questions