Pages Navigation Menu

Coding is much easier than you think

RECENT POSTS

Comparison of Performance between different for loops in java

Posted by in Core Java, Java

Comparison of Performance between different for loops in java

  In this post, we will compare the performance of different for loops in java   Different ways to use for loop   1) For each statement   In this technique, advanced for each statement introduced in java 5 is used.   private static List<Integer> list = new ArrayList<>(); for(Integer i : list) { // logic here }   2) Using list.size() in condition   private static List<Integer> list = new ArrayList<>(); for(int j = 0; j < list.size() ; j++) { // logic...

read more

Spring AOP “BeforeAdvice, AfterReturningAdvice

Posted by in Spring

Spring AOP “BeforeAdvice, AfterReturningAdvice

  Download It AOP concept – BeforeAdvice, AfterReturningAdvice   Considering a log has to be printed once the method execution(in this case, after value is returned from method) in the ‘target’ bean is complete, then AfterReturningAdvice can be made use of. To insert this functionality into our existing code, let us expand the existing scenario and take that another method(goPrevious() ) is present in the existing interface -Iterator and subsequently defined in IteratorImpl class. The design...

read more

How to Manage NULLs when Sorting Data

Posted by in Oracle

How to Manage NULLs when Sorting Data

  Consider a scenario such that you want to sort data in descending order, for example Given a table student (gateId, name, score), now to arrange the students by their GATE scores the following query can be used. Select * from Student 'ORDER BY score DESC'   Now consider a scenario such that some students who did not take the GATE at all, now their scores in the table are not zero, but they are null. In this case Oracle’s ORDER BY..DESC will give a surprise result. Here’s how the result will look with the ORDER BY…DESC...

read more

Creating an android application (Activity to Activity) using Eclipse:

Posted by in Android

Creating an android application (Activity to Activity) using Eclipse:

In this Tutorial, you will be Learning , 1. How to create and start a new activity? 2. How to invoke an activity from an existing activity? 3. How to Manage life cycle of an activity when more than one activity interacts with each other Here you go!!!! Before creating an android application using Eclipse, let us see some of the key terms involved in this application. Key terms involved in this project: Activity: An activity provides a user interface for a single screen in your application. The window typically fills the screen, but may be...

read more

APP FUNDAMENTAL CONCEPTS

Posted by in Android

APP FUNDAMENTAL CONCEPTS

  Before creating an android application using Eclipse, let us see some of the key terms involved while developing an application.   Key terms involved are: 1.       Activity:  An activity provides a user interface for a single screen in your application. The window typically fills the screen, but may be smaller than the screen and float on top of other windows. An application usually consists of multiple activities that are loosely bound to each other. The various folders/files available in an eclipse project  that are...

read more

Android Development Environment Setup in Eclipse.

Posted by in Android

Android Development Environment Setup in Eclipse.

In this Tutorial, you will learn How to setup Android Development Environment in Eclipse Here you go!!!!   Before we start off with coding, let us see what is required to develop an android application. Three simple things for developing android applications are: IDE (Integrated Development Environment) ADT (Android Development Tool) Plugin Android SDK (Software development Kit) System Requirements for developing android application:   ** UPDATE: Android Complete tutorial now available here.   Operating Systems: Windows XP...

read more

Android – Hello World

Posted by in Android

Android – Hello World

In this tutorial we will be seeing,                     1. How to create a new android application    2. How to create a simple activity?        Here you go!!!! Before creating an android application using Eclipse, let us see some of the key terms involved while developing this application. Key terms involved in this project: Activity: An activity provides a user interface for a single screen in your application. The window typically fills the screen, but may be smaller than the screen and float on top of other windows....

read more

Spring framework architecture

Posted by in Spring

Spring framework architecture

  Spring has a layered architecture which consists of various modules. All the modules are built on top of the core container and are mostly independent. This way, the developer is free to use only the modules that are needed for the particular requirements. The modules in Spring framework are grouped into Core Container, Data Access/Integration, Web, AOP (Aspect Oriented Programming), Instrumentation, and Test.   ** UPDATE: Spring Complete tutorial now available here.     CORE CONTAINER   Core and Beans provide the...

read more

First hands on with spring

Posted by in Spring, Spring Tutorial

First hands on with spring

  Download It First Hands On With Spring Get your Eclipse IDE ready and make sure you are working on JDK 5 or above.   ** UPDATE: Spring Complete tutorial now available here.   1. Create a new Java Project Select File->New->Java project and provide an appropriate name for the project in the window that opens up.   2. Adding libraries: Now you have a project ready to explore the world of Spring. Add the required library files that are needed to support Spring. You can download the latest...

read more

Constructor injection for reference bean

Posted by in Spring, Spring Tutorial

Constructor injection for reference bean

      Download It Constructor injection for reference bean The basic working of spring framework is now clear. Now, we can keep doing modifications in the existing base project to further build on our understanding. Let us take up a practical scenario for the next step. One of the attributes of a class <Candidate> is another class<Address>. The value of the class Candidate depends on the value of the Class Address. i.e., there is a dependency here.     In case of constructor...

read more