Filter interviews by
posted on 7 Aug 2024
I applied via Naukri.com and was interviewed in Feb 2024. There were 4 interview rounds.
Immutable class is a class whose instances cannot be modified after creation.
Instances of immutable class cannot be changed once created
Immutable classes are often used for objects that should not be modified, like dates or strings
Examples of immutable classes in Java are String, Integer, and LocalDate
Immutable class can be created by making all fields private and final, providing only getters and no setters.
Make all fields private and final
Provide only getters, no setters
Avoid modifying state within the class
A singleton class is a class that can only have one instance created throughout the entire application.
Singleton classes are often used for logging, driver objects, caching, thread pools, database connections, etc.
They have a private constructor to prevent instantiation from other classes.
They provide a global point of access to the instance.
Immutable class is a class whose state cannot be modified after creation.
Use final keyword to make class immutable
Make all fields private and final
Do not provide setter methods
Return new instances when modifying state
Immutable class program in Java
Use the 'final' keyword to make class immutable
Make all fields private and final
Do not provide setter methods, only getter methods
Ensure deep copy of mutable objects in constructor or getter methods
Controller is a general term for classes that handle incoming requests, while RestController is specifically for RESTful web services in Spring.
Controller is a general term for classes that handle incoming requests in a web application.
RestController is a specialized version of a controller that is used for creating RESTful web services in Spring framework.
RestController is annotated with @RestController, which combine...
No, controller and service annotations serve different purposes in a software application.
Controller annotations are used to define the entry points for incoming requests and map them to specific methods in a controller class.
Service annotations are used to mark a class as a service component that can be injected into other classes for business logic implementation.
Mixing up controller and service annotations can lead ...
=== is a strict equality operator in JavaScript that checks if two values are equal in type and value.
=== compares two values without type conversion
Returns true if both values are strictly equal, false otherwise
Example: 5 === '5' returns false because they are of different types
Heap memory is used for dynamic memory allocation, while stack memory is used for static memory allocation.
Heap memory is allocated at runtime and can be accessed randomly, while stack memory is allocated at compile time and is accessed in a LIFO order.
Heap memory is managed manually by the programmer, while stack memory is managed automatically by the system.
Heap memory is larger in size compared to stack memory, but ...
JSP stands for JavaServer Pages, a technology used for creating dynamic web pages using Java.
JSP allows embedding Java code in HTML pages
It is compiled into servlets by the server before execution
JSP simplifies the process of developing web applications by separating the presentation layer from the business logic
Top trending discussions
posted on 24 Jun 2024
based on 1 review
Rating in categories
Software Specialist
505
salaries
| ₹2 L/yr - ₹11 L/yr |
Strategic Account Manager
221
salaries
| ₹3 L/yr - ₹10 L/yr |
Project Manager
206
salaries
| ₹4.2 L/yr - ₹13.2 L/yr |
Implementation Specialist
120
salaries
| ₹3 L/yr - ₹12 L/yr |
Software Developer
119
salaries
| ₹5.2 L/yr - ₹21 L/yr |
Oracle Cerner
Veradigm
Athenahealth Technology
NextGen Healthcare