WorksheetsJava Full Stack Developer preparation basic 0.01
Total questions: 59
Worksheet time: 30mins
Which of the following is NOT an OOP principle?
Inheritance
Polymorphism
Compilation
Encapsulation
What is the default value of an instance variable in Java?
null
0
Depends on datatype
Undefined
Which keyword is used to prevent inheritance in Java?
static
final
private
abstract
Which memory area stores objects in Java?
Stack
Method Area
Heap
Register
Which method is called before object destruction?
destroy()
delete()
finalize()
clean()
Which exception is unchecked?
IOException
SQLException
NullPointerException
FileNotFoundException
What is the parent class of all Java classes?
System
Object
Class
Runtime
Which keyword is used to achieve abstraction?
abstract
interface
Both A and B
final
Which access modifier allows visibility within package only?
public
private
protected
default
Which collection does NOT allow duplicates?
List
Set
ArrayList
LinkedList
HashMap stores data in the form of?
Objects
Index-value
Key-value pairs
Nodes
Which class is thread-safe?
StringBuilder
StringBuffer
ArrayList
HashMap
Which keyword is used to create a thread?
thread
Runnable
new
synchronized
Which statement about constructors is true?
They have return type
They can be inherited
They initialize objects
They are static
Which keyword refers to current object?
this
super
static
final
Lambda expressions were introduced in which Java version?
Java 6
Java 7
Java 8
Java 11
Which interface has exactly one abstract method?
Marker Interface
Functional Interface
Serializable
Cloneable
Which package supports Stream API?
java.io
java.util
java.util.stream
java.lang
Which method converts collection to stream?
map()
stream()
filter()
collect()
Optional class is used to handle?
Multithreading
NullPointerException
IO operations
Collections
Which method terminates stream processing?
filter()
map()
forEach()
peek()
Which Java 8 feature improves date handling?
Calendar
Date
java.time
Timestamp
What does IoC stand for?
Injection of Code
Inversion of Control
Instance of Class
Integration of Components
Which annotation is used to create REST controller?
@Controller
@Service
@RestController
@Component
Which file configures Spring Boot application?
web.xml
application.properties
pom.xml
spring.xml
Default embedded server in Spring Boot?
WebLogic
JBoss
Tomcat
GlassFish
Which annotation injects dependency?
@Inject
@Autowired
@Resource
All of the above
Which annotation maps HTTP GET requests?
@PostMapping
@GetMapping
@RequestBody
@PathVariable
Which layer contains business logic?
Controller
Repository
Service
Entity
Spring Data JPA is used for?
UI development
Database access
Security
Logging
Which annotation defines primary key?
@Column
@Entity
@Id
@Table
Which fetch type loads data immediately?
LAZY
EAGER
AUTO
DEFAULT
Which annotation enables Spring Security?
@EnableSecurity
@EnableWebSecurity
@SecurityConfig
@SecureApp
JWT is mainly used for?
Encryption
Authentication
Logging
Serialization
Which annotation handles exceptions globally?
@ControllerAdvice
@ExceptionHandler
@RestControllerAdvice
@ResponseStatus
Hibernate is an implementation of?
JDBC
JPA
Servlet
JSP
Which annotation marks a class as entity?
@Table
@Column
@Entity
@Id
Which SQL command is used to remove table data?
DELETE
DROP
TRUNCATE
REMOVE
Which JOIN returns all matching records?
LEFT JOIN
RIGHT JOIN
INNER JOIN
FULL JOIN
ACID stands for?
Atomicity, Consistency, Isolation, Durability
Accuracy, Consistency, Isolation, Data
Atomic, Correct, Isolation, Data
None
Which SQL constraint ensures uniqueness?
PRIMARY KEY
UNIQUE
NOT NULL
CHECK
JPQL operates on?
Tables
Columns
Objects
Rows
Which annotation maps table name?
@Column
@Entity
@Table
@JoinColumn
Which transaction property avoids dirty reads?
Atomicity
Isolation
Consistency
Durability
Which SQL clause filters grouped data?
WHERE
GROUP BY
HAVING
ORDER BY
Which HTML tag is semantic?
div
span
section
b
CSS Flexbox is used for?
Styling text
Layout design
Animations
Database
Which JavaScript keyword declares constant?
var
let
const
static
REST stands for?
Real State Transfer
Representational State Transfer
Remote Service Tool
Runtime Service Type
Which HTTP method is idempotent?
POST
PATCH
GET
CONNECT
Which status code means “Not Found”?
200
401
403
404
React/Angular uses which architecture?
Monolithic
MVC
Component-based
Layered
Which Git command uploads code?
git pull
git push
git commit
git clone
Which command creates new branch?
git fork
git new
git branch
git checkout
Which tool manages dependencies?
Git
Maven
Docker
Jenkins
Which file defines Maven dependencies?
build.gradle
pom.xml
package.json
settings.xml
CRUD stands for?
Create Read Update Delete
Compile Run Update Delete
Create Remove Update Drop
None
Which API documentation tool is common in Spring?
Postman
Swagger
Jenkins
Nexus
Which testing framework is used in Java?
Selenium
JUnit
Cypress
Jest
