Sei sulla pagina 1di 2

compositions having class of another class

composition s is one class is having the object of another class

encupsations nothing but binding the data and behaviour into single class

pojo class is exaples of encapsualtons

abstraction nothing but exposing the functionality but not the implemetations.

abstract class and interface are the abstrations .

means u know the structure of class but u dnt know the functioning of class

java 1.8 features.

wait method used for synchronization block.

wait method indefinite amount of time untill the another thread going to notify

sleep method is pause a tread for particular amount of time

sleep method doent have any depndancy for another thread.

wait method have the dependancy for nofify the other thread.

wait method throws IllegalMonitorException when method is called outside the


synchronized block

Deadlock: Deadlock is a situation when two threads are waiting for each other and
the waiting is never ends. Here both threads cant completes their tasks.

In Starvation, threads are also waiting for each other. But here waiting time is
not infinite after some interval of time, waiting thread always gets the resources
whatever is required to execute thread run() method.

Thread Pool

Threal Local class

object lock- class lock

Lambda Functions:
================

Potrebbero piacerti anche