100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

interview questions java developer Questions and Answers

Rating
-
Sold
-
Pages
34
Grade
A+
Uploaded on
04-08-2024
Written in
2024/2025

What is a immutable class? ~ A defined class where state of the object cannot be modified. What is the default sorting order in TreeMap? ~ Natural Ordering What is the difference between wait() and sleep() ~ wait is from the object class, used from synchronized object block until lock is acquired . Simply used for thread synchronization. sleep is from thread class. Used for adding a delay/pause to a thread, throws InterruptedException. What are the bean scopes available in spring ? explain each scope. ~ Singleton: By default spring creates a singleton bean. One bean instance used throughout the application. Prototype: Used to create a bean every time its needed. Request: Used for Spring web aware context, each request that is made has its own instance of a bean. Session: Used for Spring web aware context, bean instantiated bases on session scope lives throughout http Session. Global Session: Used for spring w

Show more Read less
Institution
Java Developer
Course
Java developer











Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Java developer
Course
Java developer

Document information

Uploaded on
August 4, 2024
Number of pages
34
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

interview questions java
developer Questions and
Answers
What is a immutable class?


✓~ A defined class where state of the object cannot be modified.




What is the default sorting order in TreeMap?


✓~ Natural Ordering




What is the difference between wait() and sleep()


✓~ wait is from the object class, used from synchronized object block until lock is acquired

. Simply used for thread synchronization.




sleep is from thread class. Used for adding a delay/pause to a thread, throws

InterruptedException.




What are the bean scopes available in spring ? explain each scope.

,✓~ Singleton: By default spring creates a singleton bean. One bean instance used

throughout the application.




Prototype: Used to create a bean every time its needed.




Request: Used for Spring web aware context, each request that is made has its own

instance of a bean.




Session: Used for Spring web aware context, bean instantiated bases on session

scope lives throughout http Session.




Global Session: Used for spring web aware context and its defined for only portlet

application.




What is cascade delete.


✓~ When a parent row is deleted the child row should also be deleted in the database.




JAVA OOP Design Principles ? Explain Each


✓~ Encapsulation: Used to hide classes/ variables and behavior from other classes.

,Abstraction: Is a concrete class to only show certain features of the class. Can use

the abstract keyword to create abstract class. Contains abstract methods and non

abstract methods.




Inheritance: Can inherit properties / behaviors of the parent class by using the

extend keyword.




Polymorphism: I used to take a form of an object of another.




What design patterns have you worked on?


✓~ IOC -singleton

Factory

Adapter/connector




How do you implement a singleton class in java (without spring) and in java (with

spring)


✓~ Java (without spring) : have a class and make the constructor private. Create a static

method for you to get the returned instance of it.




java (with spring) : Annotate the class with @component or @service .. etc. and the

IOC container will create the bean in a default singleton scope.

, What is the volatile keyword?


✓~ It is enclosed within a synchronized block.




Thread A is accessing the volatile variable so thread B cannot access it.




This variable is read from the main memory and it does not cache it.




How do you create a immutable class ?


✓~ Declare the class as final

Declare instance variables as final

do not contain any setter.




What is the final key word. give examples for class , variable, and methods.


✓~ on class level, another class cannot extend to the final class.




on variables, variables are defined as constant. cannot be changed.




method variables as final cannot be overridden by another class.

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Graders Chamberlian School of Nursing
View profile
Follow You need to be logged in order to follow users or courses
Sold
492
Member since
2 year
Number of followers
167
Documents
25150
Last sold
11 hours ago
Study Smart

Your one-stop resource for high-quality, exam-focused study materials. Here, you'll find expertly crafted summaries, past exam papers, notes, and assignments tailored to help you succeed in your courses. Every document is written with clarity, accuracy, and exam performance in mind—saving you hours of studying and helping you boost your grades. ✅ Clear and well-structured content ✅ Covers key exam topics and common questions ✅ Trusted by students for academic success ✅ Instant downloads and affordable prices Whether you're cramming for finals or just staying ahead in class, my materials are designed to make your studying smarter, not harder. Take a look around and get the edge you need!

Read more Read less
3.8

120 reviews

5
53
4
26
3
21
2
4
1
16

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions