wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Java Full Stack Developer preparation basic 0.01

Total questions: 59

Worksheet time: 30mins

Name
Class
Date
1.

Which of the following is NOT an OOP principle?

a)

Inheritance

b)

Polymorphism

c)

Compilation

d)

Encapsulation

2.

What is the default value of an instance variable in Java?

a)

null

b)

0

c)

Depends on datatype

d)

Undefined

3.

Which keyword is used to prevent inheritance in Java?

a)

static

b)

final

c)

private

d)

abstract

4.

Which memory area stores objects in Java?

a)

Stack

b)

Method Area

c)

Heap

d)

Register

5.

Which method is called before object destruction?

a)

destroy()

b)

delete()

c)

finalize()

d)

clean()

6.

Which exception is unchecked?

a)

IOException

b)

SQLException

c)

NullPointerException

d)

FileNotFoundException

7.

What is the parent class of all Java classes?

a)

System

b)

Object

c)

Class

d)

Runtime

8.

Which keyword is used to achieve abstraction?

a)

abstract

b)

interface

c)

Both A and B

d)

final

9.

Which access modifier allows visibility within package only?

a)

public

b)

private

c)

protected

d)

default

10.

Which collection does NOT allow duplicates?

a)

List

b)

Set

c)

ArrayList

d)

LinkedList

11.

HashMap stores data in the form of?

a)

Objects

b)

Index-value

c)

Key-value pairs

d)

Nodes

12.

Which class is thread-safe?

a)

StringBuilder

b)

StringBuffer

c)

ArrayList

d)

HashMap

13.

Which keyword is used to create a thread?

a)

thread

b)

Runnable

c)

new

d)

synchronized

14.

Which statement about constructors is true?

a)

They have return type

b)

They can be inherited

c)

They initialize objects

d)

They are static

15.

Which keyword refers to current object?

a)

this

b)

super

c)

static

d)

final

16.

Lambda expressions were introduced in which Java version?

a)

Java 6

b)

Java 7

c)

Java 8

d)

Java 11

17.

Which interface has exactly one abstract method?

a)

Marker Interface

b)

Functional Interface

c)

Serializable

d)

Cloneable

18.

Which package supports Stream API?

a)

java.io

b)

java.util

c)

java.util.stream

d)

java.lang

19.

Which method converts collection to stream?

a)

map()

b)

stream()

c)

filter()

d)

collect()

20.

Optional class is used to handle?

a)

Multithreading

b)

NullPointerException

c)

IO operations

d)

Collections

21.

Which method terminates stream processing?

a)

filter()

b)

map()

c)

forEach()

d)

peek()

22.

Which Java 8 feature improves date handling?

a)

Calendar

b)

Date

c)

java.time

d)

Timestamp

23.

What does IoC stand for?

a)

Injection of Code

b)

Inversion of Control

c)

Instance of Class

d)

Integration of Components

24.

Which annotation is used to create REST controller?

a)

@Controller

b)

@Service

c)

@RestController

d)

@Component

25.

Which file configures Spring Boot application?

a)

web.xml

b)

application.properties

c)

pom.xml

d)

spring.xml

26.

Default embedded server in Spring Boot?

a)

WebLogic

b)

JBoss

c)

Tomcat

d)

GlassFish

27.

Which annotation injects dependency?

a)

@Inject

b)

@Autowired

c)

@Resource

d)

All of the above

28.

Which annotation maps HTTP GET requests?

a)

@PostMapping

b)

@GetMapping

c)

@RequestBody

d)

@PathVariable

29.

Which layer contains business logic?

a)

Controller

b)

Repository

c)

Service

d)

Entity

30.

Spring Data JPA is used for?

a)

UI development

b)

Database access

c)

Security

d)

Logging

31.

Which annotation defines primary key?

a)

@Column

b)

@Entity

c)

@Id

d)

@Table

32.

Which fetch type loads data immediately?

a)

LAZY

b)

EAGER

c)

AUTO

d)

DEFAULT

33.

Which annotation enables Spring Security?

a)

@EnableSecurity

b)

@EnableWebSecurity

c)

@SecurityConfig

d)

@SecureApp

34.

JWT is mainly used for?

a)

Encryption

b)

Authentication

c)

Logging

d)

Serialization

35.

Which annotation handles exceptions globally?

a)

@ControllerAdvice

b)

@ExceptionHandler

c)

@RestControllerAdvice

d)

@ResponseStatus

36.

Hibernate is an implementation of?

a)

JDBC

b)

JPA

c)

Servlet

d)

JSP

37.

Which annotation marks a class as entity?

a)

@Table

b)

@Column

c)

@Entity

d)

@Id

38.

Which SQL command is used to remove table data?

a)

DELETE

b)

DROP

c)

TRUNCATE

d)

REMOVE

39.

Which JOIN returns all matching records?

a)

LEFT JOIN

b)

RIGHT JOIN

c)

INNER JOIN

d)

FULL JOIN

40.

ACID stands for?

a)

Atomicity, Consistency, Isolation, Durability

b)

Accuracy, Consistency, Isolation, Data

c)

Atomic, Correct, Isolation, Data

d)

None

41.

Which SQL constraint ensures uniqueness?

a)

PRIMARY KEY

b)

UNIQUE

c)

NOT NULL

d)

CHECK

42.

JPQL operates on?

a)

Tables

b)

Columns

c)

Objects

d)

Rows

43.

Which annotation maps table name?

a)

@Column

b)

@Entity

c)

@Table

d)

@JoinColumn

44.

Which transaction property avoids dirty reads?

a)

Atomicity

b)

Isolation

c)

Consistency

d)

Durability

45.

Which SQL clause filters grouped data?

a)

WHERE

b)

GROUP BY

c)

HAVING

d)

ORDER BY

46.

Which HTML tag is semantic?

a)

div

b)

span

c)

section

d)

b

47.

CSS Flexbox is used for?

a)

Styling text

b)

Layout design

c)

Animations

d)

Database

48.

Which JavaScript keyword declares constant?

a)

var

b)

let

c)

const

d)

static

49.

REST stands for?

a)

Real State Transfer

b)

Representational State Transfer

c)

Remote Service Tool

d)

Runtime Service Type

50.

Which HTTP method is idempotent?

a)

POST

b)

PATCH

c)

GET

d)

CONNECT

51.

Which status code means “Not Found”?

a)

200

b)

401

c)

403

d)

404

52.

React/Angular uses which architecture?

a)

Monolithic

b)

MVC

c)

Component-based

d)

Layered

53.

Which Git command uploads code?

a)

git pull

b)

git push

c)

git commit

d)

git clone

54.

Which command creates new branch?

a)

git fork

b)

git new

c)

git branch

d)

git checkout

55.

Which tool manages dependencies?

a)

Git

b)

Maven

c)

Docker

d)

Jenkins

56.

Which file defines Maven dependencies?

a)

build.gradle

b)

pom.xml

c)

package.json

d)

settings.xml

57.

CRUD stands for?

a)

Create Read Update Delete

b)

Compile Run Update Delete

c)

Create Remove Update Drop

d)

None

58.

Which API documentation tool is common in Spring?

a)

Postman

b)

Swagger

c)

Jenkins

d)

Nexus

59.

Which testing framework is used in Java?

a)

Selenium

b)

JUnit

c)

Cypress

d)

Jest