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

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


Correct Option: D

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

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

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


Correct Option: A

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

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


Correct Option: C
  1. Table per Concrete class

  2. Table per Sub class

  3. Table per class Hierarchy

  4. all of the above


Correct Option: D

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

  1. True

  2. False


Correct Option: A

Two methods cannot have the same in Java

  1. True

  2. False


Correct Option: B

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

An Array can store many different types of values

  1. True

  2. False


Correct Option: B

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

  1. True

  2. False


Correct Option: A

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