Java NIO : performance Booster
Java NIO provides better performance to java application. It provides more control over I/O. It provides channels,buffers. Project Structure:- Test NIO:- Lets say demoFile.txt we need to read by NIO channel, then we have to use a FileInputStream.From This Stream we can read value and save it to ByteBuffer..Then we need to Flip method. Then […]
Google Guava Collections
Google Guava API provides collections, caching, primitives support, concurrency libraries, common annotations, string processing. This library can be downloaded from :- http://code.google.com/p/guava-libraries/ Project Structure:- Test Data:- We will build some demo data to test the Google Guava API. We will take Student as Value object. Student.java:- package com.sandeep.google.guava;import java.io.Serializable;public class Student implements Serializable { […]
Quartz Scheduler Scheduling Job in Java
For a scheduled job in java we have three main components JOB,TRIGGER,SCHEDULER. Quartz Scheduler is one of the API in java provides scheduling a job. The Library can be downloaded from :- http://quartz-scheduler.org/downloads The required jar files are :- quartz-2.1.6.jar, quartz-all-2.1.6.jar, […]
Object Comparison & Ordering in Java
Comparison between two objects is a very important in object oriented programming. Two objects with same values for their field is never same.But if it is required to equalize two object if their fields are same then we need to override equal and hash code methods. Example Student class:- package com.sandeep.object.compare;public class Student { private […]