100% tevredenheidsgarantie Direct beschikbaar na betaling Zowel online als in PDF Je zit nergens aan vast
logo-home
interview questions (java developer) | Questions & Answers (100 %Score) Latest Updated 2024/2025 Comprehensive Questions A+ Graded Answers | With Expert Solutions €12,89   In winkelwagen

Tentamen (uitwerkingen)

interview questions (java developer) | Questions & Answers (100 %Score) Latest Updated 2024/2025 Comprehensive Questions A+ Graded Answers | With Expert Solutions

 4 keer bekeken  0 keer verkocht
  • Vak
  • Java Programming Interview
  • Instelling
  • Java Programming Interview

interview questions (java developer) | Questions & Answers (100 %Score) Latest Updated 2024/2025 Comprehensive Questions A+ Graded Answers | With Expert Solutions

Voorbeeld 3 van de 19  pagina's

  • 7 augustus 2024
  • 19
  • 2024/2025
  • Tentamen (uitwerkingen)
  • Vragen en antwoorden
  • Java Programming Interview
  • Java Programming Interview
avatar-seller
interview questions (java developer) | Questions & Answers (100 %Score) Latest Updated
2024/2025 Comprehensive Questions A+ Graded Answers | With Expert Solutions


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.



What is the static keyword. give examples. - Can declare a static class within a class.



Memory for all static variables will be allocated and this will be done only once



static methods can be called from any where by

calling the class ex: Class.staticMethod()



1. Given Employee Class . How can you sort out the data available in a list of employees.



2. Given Employee Class with age . How can you sort out the data by age . - implementing Comparable
on the Employee class and overriding compareTo method



then Collections.sort(employeeList) will sort employees.




Create a new class called EmployeeAgeComparator implementing comparator , then overriding compare
method .



using Collections.sort(employeeList, employeeAgeComparator) will sort the list by age.



What are generics ? - Customize class or methods to whatever type you are working with.



Can use T to return the object

Voordelen van het kopen van samenvattingen bij Stuvia op een rij:

Verzekerd van kwaliteit door reviews

Verzekerd van kwaliteit door reviews

Stuvia-klanten hebben meer dan 700.000 samenvattingen beoordeeld. Zo weet je zeker dat je de beste documenten koopt!

Snel en makkelijk kopen

Snel en makkelijk kopen

Je betaalt supersnel en eenmalig met iDeal, creditcard of Stuvia-tegoed voor de samenvatting. Zonder lidmaatschap.

Focus op de essentie

Focus op de essentie

Samenvattingen worden geschreven voor en door anderen. Daarom zijn de samenvattingen altijd betrouwbaar en actueel. Zo kom je snel tot de kern!

Veelgestelde vragen

Wat krijg ik als ik dit document koop?

Je krijgt een PDF, die direct beschikbaar is na je aankoop. Het gekochte document is altijd, overal en oneindig toegankelijk via je profiel.

Tevredenheidsgarantie: hoe werkt dat?

Onze tevredenheidsgarantie zorgt ervoor dat je altijd een studiedocument vindt dat goed bij je past. Je vult een formulier in en onze klantenservice regelt de rest.

Van wie koop ik deze samenvatting?

Stuvia is een marktplaats, je koop dit document dus niet van ons, maar van verkoper VasilyKichigin. Stuvia faciliteert de betaling aan de verkoper.

Zit ik meteen vast aan een abonnement?

Nee, je koopt alleen deze samenvatting voor €12,89. Je zit daarna nergens aan vast.

Is Stuvia te vertrouwen?

4,6 sterren op Google & Trustpilot (+1000 reviews)

Afgelopen 30 dagen zijn er 83750 samenvattingen verkocht

Opgericht in 2010, al 14 jaar dé plek om samenvattingen te kopen

Start met verkopen
€12,89
  • (0)
  Kopen