wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Milestone-4 MCQ Practice Test

Total questions: 80

Worksheet time: 1hrs 17mins

Name
Class
Date
1.

Which of the following is true about ORM?

a)

ORM stands for Object-Relational Mapping

b)

ORM is a programming technique for converting data between relational databases and object oriented programming languages

c)

Both

d)

None

2.

In which file database table configuration is stored?

a)

.dbm

b)

.hbm

c)

.ora

d)

.sql

3.

Which of the following is not a state of object in Hibernate?

a)

Persistent()

b)

Detached()

c)

Attached()

d)

Transient()

4.

Which of the following object is used to create SessionFactory object in hibernate?

a)

SessionFactory

b)

Transaction

c)

Configuration

d)

Session

5.

Which of the following is true about query level cache in hibernate?

a)

Query level cache requires two additional physical cache regions that hold the cached query results and the timestamps when a table was last updated

b)

Query level cache is an optional feature

c)

Query level cache is only useful for queries that are run frequently with the same parameters

d)

All of the above

6.

Which of the following are most common configuration methods of Hibernate Configuation

a)

Http.conf

b)

XML Configuration hibernate.cfg.xml

c)

Web.config

d)

Mapping files

7.

Which of the following is FALSE about Session in hibernate

a)

Session represents a single unit-of-work with the database

b)

Session is the primary interface for the persistence service

c)

Session is a light weight non-threadsafe object

d)

You can share the session between threads

8.

Which of the following is NOT a mapping association used in Hibernate?

a)

One-to-Many Association

b)

One-to-One Association

c)

Many-to-Many Association

d)

None

9.

Which of the following is true about hibernate annotations?

a)

All the metadata is clubbed into the POJO java file along with the code this helps the user to understand the table structure and POJO simultaneously during the development

b)

Hibernate Annotations is the powerful way to provide the metadata for the Object and Relational Table mapping

c)

Both of the above

d)

None of the above

10.

Transient and detached objects in hibernate are

a)

Instances of persistent class that are not currently associated with session

b)

Instances of persistent class which are in session

11.

org.hibernate.cfg.Configuration can be used for all configuration and no need of XML.

a)

False

b)

True

12.

Persistent objects and collections in hibernate are

a)

Short-lived, single threaded objects

b)

Long-lived, multi threaded objects

13.

Is it necessary to use hibernate.cfg.xml for configuration in hibernate?

a)

Yes

b)

No

14.

In the elements of Hibernate architecture is a factory of session and client of ConnectionProvider, It holds the second level cache (optional) of data is ?

a)

Session

b)

Transaction

c)

SessionFactory

d)

ConnectionProvider

15.

Hibernate is an?

a)

Open Source

b)

Lightweight

c)

ORM

d)

All mentioned above

16.

1. Which of the following is not a core interface of Hibernate?

a)

a) Configuration

b)

b) Criteria

c)

c) SessionManagement

d)

d) Session

17.

2. Which of the following methods hits database always?

a)

a) load()

b)

b) loadDatabase()

c)

c) getDatabase()

d)

d) get()

18.

3. Which of the following is not an advantage of Hibernate Criteria API?

a)

a) Allows to use aggregate functions

b)

b) Cannot order the result set

c)

c) Allows to fetch only selected columns of result

d)

d) Can add conditions while fetching results

19.

4.Which ways are used by the Log4j and Logback frameworks in hibernate framework to support logging?

a)

a. By log4j.xml file

b)

b. By log4j.properties

c)

c. Both A & B

d)

d. None of the above

20.

5.We need to specify @Inheritance(strategy=InheritanceType.JOINED) in the parent class and @PrimaryKeyJoinColumn annotation in the subclasses.

a)

a. True

b)

b. False

21.

6.Abbreviate the term HQL?

a)

a. Hibernate Queue Language

b)

b. Hibernate Query Language

c)

c. Hipher Query Language

d)

d. None of the above

22.

7.Which of the following is NOT a mapping association used in Hibernate?

a)

A. Many-to-Many Association

b)

B. One-to-Many Associationcorrect

c)

C. One-to-One Association

d)

D. None

23.

8.Which of these simplifies an Object Relational Mapping tool?

a)

A. Data creation

b)

B. Data manipulation

c)

C. Data access

d)

D. All mentioned above

24.

Spring is licensed under

a)

GNU

b)

Apache License 2.0

c)

GNU Lesser General Public License

d)

Open source

25.

Spring is developed by

a)

Red Hat Software

b)

Daniel Fernández

c)

Apache

d)

Pivotal Software

26.

Which spring module provides the capability of DI or IOC?

a)

Spring web

b)

Core container

c)

AOP

d)

Data access

27.

POJO abbreviation

a)

plain old java object

b)

practical java object

c)

project java object

d)

plain oriented java object

28.

is used to create the objects wire them together

a)

java

b)

injection

c)

container

d)

object

29.

EJB abbreviation

a)

Enterprise java beans

b)

Enrich java beans

c)

Emerge java beans

d)

Enlight java beans

30.

____supports transaction management

a)

JSP

b)

EJB

c)

JTS

d)

DAO

31.

___________modules support aspect oriented

programming implementation where you can use Advices,

Pointcuts etc. to decouple the code.

a)

AOP

b)

DAO

c)

JSP

d)

JDBC

32.

In spring _________ tool is used

a)

swing

b)

hibernate

c)

maven

d)

struts

33.

True or False: You can declare a controller class by using the @Controller annotation

a)

True

b)

False

34.

To map the controller class and its methods with URL you must use

a)

@Controller

b)

@Override

c)

@RequestMapping

d)

@ControllerMapping

35.

Given the following code, how should you invoke show.jsp in the browser’s address bar? Note that View Resolver is already in place.

a)

<host>/show.jsp

b)

<host>/form/display.jsp

c)

<host>/display.jsp

d)

<host>/form/show

36.

Which of the following contains your business logic and handles request?

a)

Web Browser

b)

Controller

c)

Model

d)

View

37.

Given the following code, what would be the value of the model attribute “name”

a)

JUAN DELA CRUZ

b)

Juan dela Cruz

c)

JUAN dela Cruz

d)

juan DELA CRUZ

38.

Given the following code, what is the equivalent getter method of firstName in student class in Java?

a)

student.getFirstName

b)

student.getfirstName

c)

student.firstName

d)

None of the above

39.

How do you represent the drop-down list in Spring MVC Tag?

a)

<form:drop>

b)

<form:dropDown>

c)

<form:list>

d)

<form:select>

40.

What is the default value of an input tag?

a)

number

b)

date

c)

email

d)

text

41.

This component contains the data of the application.

a)

Controller

b)

Model

c)

View

d)

None of the above

42.

Which annotation is used in Spring Boot for mapping HTTP requests to controller methods?

a)

@RequestMapping

b)

@ResponseBody

c)

@RestController

d)

@Autowired

43.

Which HTTP status code indicates that the requested resource was not found?

a)

200

b)

404

c)

500

d)

401

44.
What is Spring Framework in Java introduction?
a)
Java enterprise framework.
b)
Dependency injection and inversion of control.
c)
Simplifies application development.
d)
Integrates with other frameworks.
e)
All of the above
45.
What is autowiring in Spring?
a)
Dependency injection
b)
Database connection
c)
Multithreading
d)
Object serialization
46.

Hibernate is a

a)

Database connectivity Tool

b)

ORM framework

c)

Query Executer

d)

None of the Above

47.

It is a Java specification that provides certain functionality and standard to ORM tools.

a)

Hibernate

b)

JPA

c)

Dev Tools

d)

Spring Data

48.

Which annotation is used for mapping the primary key of an Entity in Hibernate/JPA?

a)

@PrimaryKey

b)

@Id

c)

@PK

d)

@Key

49.

Hibernate uses which API internally for communicating with the Database?

a)

JPA

b)

JDBC

c)

JTA

d)

JMS

50.

Which of the following is true about ORM?

a)

ORM stands for Object-Relational Mapping

b)

ORM is a programming technique for converting data between relational databases and object oriented programming languages

c)

Both

d)

None

51.

Hibernate is an?

a)

Open Source

b)

Lightweight

c)

ORM

d)

All mentioned above

52.

What is the core container module in the Spring Framework?

a)

Spring Boot

b)

Spring Web

c)

Spring MVC

d)

Spring IoC

53.

Which embedded web server is supported by default in Spring Boot?

a)

Tomcat

b)

GlassFish

c)

WildFly

d)

Jetty

54.

What does the term "Inversion of Control" (IoC) refer to in Spring?

a)

A control statement in programming logic

b)

A design pattern for creating classes

c)

The process of controlling hardware devices

d)

The management of object dependencies by a container

55.

Which of the following is a microframework built on top of the Spring Framework?

a)

Spring Data

b)

Spring Boot

c)

Spring Security

d)

Spring Cloud

56.

Building a project includes______

a)

Compiling

b)

Packaging

c)

Running Tests

d)

Deploying

57.

Which of the following file is used to add plugins/ dependencies to your maven project?

a)

package.json

b)

index.jsp

c)

pom.xml

d)

pom.json

58.

What is an archetype in maven?

a)

A template for any type of Java project

b)

package for maven librairies

c)

configuration file

d)

source package

59.

Maven is _____

a)

Project management tool

b)

Build tool

c)

Dependency manager

d)

All of these

60.

Which of the following is not a valid archive file type?

a)

jar

b)

war

c)

ear

d)

car

61.

Which of the following is NOT a benefit of using Spring Boot for web service development?

a)

Minimal XML and annotation-based configuration

b)

Rapid application development with minimal boilerplate code

c)

Complicated setup process

d)

Easy integration with other Spring modules

62.

Which annotation is used in Spring Boot for mapping HTTP requests to controller methods?

a)

@RequestMapping

b)

@ResponseBody

c)

@RestController

d)

@Autowired

63.

What is the purpose of using tools like Postman in web service development?

a)

To automate server deployment

b)

To generate HTML templates

c)

To interact with and test HTTP APIs

d)

To debug Java code

64.

Which annotation in Spring Boot is used for versioning the API?

a)

@RequestMapping

b)

@RestController

c)

@PathVariable

d)

@SpringBootApplication

65.

Which HTTP method is used to retrieve data from a server in RESTful services?

a)

GET

b)

POST

c)

DELETE

d)

PUT

66.

What is the purpose of ResponseEntity<T> in Spring Boot?

a)

To handle HTTP request headers

b)

To manage database transactions

c)

To customize HTTP response entities

d)

To parse XML data

67.

Which of the following is NOT a component of the MVC architecture in Spring Boot?

a)

Model

b)

View

c)

Service

d)

Configuration

68.

What does the @PathVariable annotation in Spring Boot do?

a)

It maps the request body to a method parameter

b)

It extracts values from the URI path

c)

It defines the version of the API

d)

It specifies the HTTP method to use

69.

Which HTTP status code indicates that the requested resource was not found?

a)

200

b)

404

c)

500

d)

401

70.

What is the purpose of the @RestController annotation in Spring Boot?

a)

To define the version of the API

b)

To handle HTTP requests

c)

To specify the HTTP method to use

d)

To provide a way to version the API

71.

Hibernate is an implementation of the Java Persistence API (JPA) specification.

a)

TRUE

b)

FALSE

72.

It is a Java specification that provides certain functionality and standard to ORM tools.

a)

Hibernate

b)

JPA

c)

Dev Tools

d)

Spring Data

73.

It is an open source Java-based framework used to create stand-alone, production-grade Spring based Applications that you can "just run"

a)

Spring Data

b)

Spring JPA

c)

Spring Boot

d)

Spring MVC

74.

It is mainly used to expose operational information about the running application — health, metrics, info, dump, env, etc

a)

Dev Meter

b)

Spring Starters

c)

Dev Tools

d)

Actuator

75.

Which is not a source folder

a)

src/test/java

b)

src/main/java

c)

scr/main/test

d)

scr/main/resources

76.

it contains information of configuration for the maven to build the project such as dependencies, build directory, source directory, test source directory, plugin etc.

a)

maven wrapper configuration

b)

application.properties

c)

pom.xml file

d)

application.xml

77.

It is a web-based tool to generate the structure of the Spring Boot Project.

a)

Spring Resource Manager

b)

Spring Project Generator

c)

Spring Boot Starter

d)

Spring Initializr

78.

What is the output of the program when accessed to context root URL?

a)

Hellostar

b)

whitelabel error page

c)

Hello***********

d)

None of the above

79.

Application.properties file has user defined property named game.name. Choose the correct way in accessing this property and pass it into a variable.

a)

'@Value("$(game.name)") private String gameName;

b)

String gameName = properties.get("$(game.name)");

c)

'@Value("${game.name}") private String gameName;

d)

String gameName = properties.get("${game.name}");

80.

Which of the following is not TRUE.

a)

Spring Boot provides default configurations to build Spring-powered framework.

b)

Spring Boot does not need to build configuration manually.

c)

Spring Boot specifies each dependency separately.

d)

Spring Boot reduces development time and increases productivity