Lambda Expressions Examples

Best way of learning about Lambda expressions is by examples. Following are few examples: Thread can be initialized like following:

Similar posts: Trade Life Cycle/Securities trade life cycle Investment Banking Concepts Java Reflection Java Reflection – Private Fields and Methods Using JDBC without Spring

Continue reading

Bean lifecycle and CallBack Methods in Spring

Following is sequence of a bean lifecycle in Spring: Instantiate– First the spring container finds the bean’s definition from the XML file and instantiates the bean.. Populate properties– Using the dependency injection, spring populates all of the properties as specified in the bean definition.. Set Bean Name– If the bean…

Continue reading

Hibernate-Interview-Preparation

Explain Lifecycle of Pojo Life of Pojo has 3 states Transient state Persistent state Detached state Transient state : When ever an object of a pojo class is created then it is in Transient state In Transient state it doesn’t represent any row of the database and it is not associated…

Continue reading

Java Memory and Performance Interview Questions

This post is a compilation of many useful articles available on Internet.Their references can be found at the end of the post. Java Memory and Performance Improvement tips: How would you improve performance of a Java application? Pool valuable system resources like threads, database connections, socket connections etc. Emphasize on…

Continue reading

Race condition in Java multi-threading

Race condition occurs in a multi-threaded environment when more than one thread try to access a shared resource (modify, write) at the same time. Note that it is safe if multiple threads are trying to read a shared resource as long as they are not trying to change it. Since…

Continue reading

ConcurrentHashMap

ConcurrentMap The java.util.concurrent.ConcurrentMap interface represents a Map which is capable of handling concurrent access (puts and gets) to it. The ConcurrentMap has a few extra atomic methods in addition to the methods it inherits from its superinterface, java.util.Map. ConcurrentMap Implementations Since ConcurrentMap is an interface, you need to use one…

Continue reading

Design Pattern Compilation

Command Pattern The client passes a request, this request gets propagated as a command. The command request maps to particular modules. According to the command, a module is invoked. This pattern is different from the Chain of Responsibility in a way that, in the earlier one, the request passes through…

Continue reading

Retrieving Objects using session.get()

In this post we will retrieve the record that we have inserted in previous post As SessionFactory is one per application and its very expensive we will use the same sessionFactory object which we used to save the record and get a new session from it to retrieve the record.…

Continue reading

Useful Annotation for Model Class

In out previous post we have see how we can change the table name and the Model name using the @Entity (name=”TABLE_NAME“)  and @Column (name=”COLUMN_NAME“)   Here when we use the @Entity (name=”TABLE_NAME“) the entity name  also gets changed,so if we want to change only the table then use @Table(name=”TABLE_NAME”) suppose we…

Continue reading