Home > Core Java
How ClassLoader Loads Classes in Java
April 01, 2014
To load classes in java platform, java uses different Class loader and each class loader searches classes in a defined path. Here in this tutorial we are explaining three class loaders... Dynamic Proxy with Proxy and InvocationHandler in Java
March 31, 2014
A proxy calls object method indirectly through the proxy object. java.lang.reflect API provides a class as Proxy and an interface as InvocationHandler. Together these two API creates dynamic proxy class... Thread Communication Using Wait and Notify in Java
March 23, 2014
In java, threads can communicate to each other in many ways. One of the way is using wait and notify. wait() and notify() belongs to Object class in java. In our example we have a producer thread and second is consumer thread... Thread Communication Using Volatile in Java
March 23, 2014
In java, volatile is thread safe variable. All the threads watch the most up-to-date value of the volatile variable automatically. Because of its visibility feature... Custom ClassLoader Java Example
March 12, 2014
java.lang.ClassLoader loads a class. To load our own class we can create custom ClassLoader also. Using ClassLoader, we can load classes from desired location like from another location etc... Add Manifest into JAR File Using Java
March 04, 2014
In java while creating jar programmatically, we need to add MANIFEST.MF file. Java provides java.util.jar.Manifest class that is used to add manifest file while creating jar... Example of JarOutputStream in Java
February 28, 2014
java.util.jar.JarOutputStream is a class that is used to write contents of a jar. A jar is a type of archive file and java provides JarOutputStream class that can efficiently write jar with flexibility of setting manifest file... Example of JarInputStream in Java
January 17, 2014
java.util.jar.JarInputStream reads the jar from an input stream. If we read a jar normally as input stream, then we cannot know the jar details effectively in our application. Java provides the JarInputStream... JAR Packer and Unpacker with Pack200 Format in Java
January 16, 2014
Java provides an approach to reduce the size of Jar so that it can travel on HTTP network faster to deploy jar on a website. Pack200 is a format to compress and decompress jar files... Java Callable Example
January 09, 2014
java.util.concurrent.Callable has been introduced in JDK 5 . Callable is a thread that returns the result. There is a method call() in Callable interface that must be overridden for computation task... Java ThreadFactory Example
December 30, 2013
java.util.concurrent.ThreadFactory creates a new thread and has been introduced in JDK 5. ThreadFactory is an interface and is implemented by a user class to override it. ThreadFactory has a method... Java Future Example
December 29, 2013
java.util.concurrent.Future has been introduced in JDK 5 and is the part of executor framework. It represents the output of an asynchronous computation. Future has many methods that check the health of running task... Example of BlockingDeque in Java
December 29, 2013
java.util.concurrent.BlockingDeque has been introduced in JDK 6 and is the part collection framework. BlockingDeque is a deque collection which supports blocking operation. Deque is a queue that supports... Java NIO Framework with Example
December 29, 2013
After IO, java provides new IO. That is also called NIO and has been introduced from JDK 1.4. NIO brings so many features to read and write to files, channels and sockets. There is two generation of NIO API... Java Executor Framework Tutorial and Example
December 28, 2013
Java Executor Framework is a framework that manages threads to start, execute and terminate. Java Executor Framework provides different classes and methods that manage to create thread pool of fixed... Encode and Decode in Java NIO
December 13, 2013
In java encode and decode from one charset to another charset can be done using java NIO API. A ByteBuffer with any charset can be changed to CharBuffer in Unicode charset... Example of Charset in Java NIO
December 13, 2013
java.nio.charset.Charset has been introduced in JDK 1.4. Charset plays the role of encoding and decoding between given charset and UNICODE. Charset name should follow some rule... Example of MembershipKey in Java NIO Channels
November 24, 2013
java.nio.channels.MembershipKey is a token. In a multicast group, when any datagram packet is sent, then it can only be received if receiver has MembershipKey... Example of Pipe in Java NIO Channels | Pipe.SinkChannel and Pipe.SourceChannel
November 24, 2013
Java.nio.channels.Pipe is a pipe that reads and writes data in a sequence. Pipe ensures that data will be read in same order in which it is written to Pipe. Pipe has Pipe.SinkChannel and Pipe.SourceChannel... Example of FileLock in Java NIO Channels
November 20, 2013
FileLock belongs to the package java.nio.channels and is available in java from JDK 1.4. FileLock locks or tries for lock for the given part of the file. Locking files is done either in shared mode... Example of FileChannel in Java NIO Channels
November 20, 2013
FileChannel belongs to the package java.nio.channels and do reading, writing and updating the files. FileChannel keeps a current position that can be modified. FileChannel can do even more task... Example of Channels with ReadableByteChannel in Java
November 19, 2013
Channels belongs java.nio.channels and is a Utility class. Channels return IO classes. ReadableByteChannel is obtained by Channels. newChannel(in) by passing Input Stream... Example of ByteOrder in Java NIO
November 17, 2013
ByteOrder belongs to the package java.nio. ByteOrder is the enumeration of byte orders. ByteOrder has two methods nativeOrder() and toString(). nativeOrder retrieves the native byte order to allocate... Example of MappedByteBuffer in Java
November 17, 2013
MappedByteBuffer is the API of java.nio package. MappedByteBuffer is the direct byte buffer. MappedByteBuffer forces the content into file. MappedByteBuffer can change the file... Example of LongBuffer and ShortBuffer in Java NIO
November 17, 2013
LongBuffer and ShortBuffer belongs to the java.nio package. These are abstract classes. To get instances of these class, there is allocate() method... Example of DoubleBuffer, FloatBuffer and IntBuffer in Java
November 16, 2013
DoubleBuffer is the buffer of double data type, FloatBuffer is the buffer of float data type. In the same way IntBuffer is the buffer of int data type... Example of CharBuffer in Java
November 15, 2013
CharBuffer is an abstract class of the java.nio package. CharBuffer is the buffer for characters. CharBuffer object is created by calling allocate(). We need to pass the capacity of CharBuffer to allocate method... Example of ByteBuffer in Java
November 15, 2013
ByteBuffer belongs to the package java.nio. ByteBuffer has been introduced in JDK 1.4. ByteBuffer is the buffer of bytes. ByteBuffer is abstract class but it has static method... Example of Wildcards in Java Generics
October 31, 2013
Wildcards (?) helps to create such method that can work for more than one type of object.Here ? means unknown object type. Simple generic declarations limit us to use only one type of object... How to write generic method in java| Generic method Example
October 31, 2013
Generic Methods is a method that takes input type of more than one class. Suppose we need to pass argument of different objects to same method. To makes it feasible we use Generic Methods... java.io.ByteArrayOutputStream Example in Java
September 28, 2013
java.io.ByteArrayOutputStream writes data in byte array inside it. java.io.ByteArrayOutputStream. ByteArrayOutputStream returns the same byte array by calling the method toByteArray... java.io.ByteArrayInputStream Example in Java
September 28, 2013
java.io.ByteArrayInputStream takes input as bye array and creates a buffer inside it. By the read method of ByteArrayInputStream, that buffer can be read. ByteArrayInputStream keeps a pointer... java.io.BufferedWriter Example in Java
September 27, 2013
java.io.BufferedWriter writes text to character output stream. BufferedWriter buffers the writing text so that it can write efficiently to a file or any other output stream source... java.io.BufferedReader Example in Java
September 27, 2013
java.io.BufferedReader reads data from Reader. Reader can be StringReader , FileReader etc. BufferedReader reads data line wise as well as character wise. BufferedReader makes reading data easy... java.io.BufferedOutputStream Example in Java
September 27, 2013
java.io.BufferedOutputStream writes byte array into a file system. BufferedOutputStream takes input as FileOutputStream. The data which needs to be written in a file should be byte array... java.io.BufferedInputStream Example in Java
September 27, 2013
java.io.BufferedInputStream is used to create internal buffer array and then the bytes are read. BufferedInputStream takes the input as InputStream to process it... java.util.Vector Example in Java
September 27, 2013
java.util.Vector has been introduced in JDK 1.1. Vector works same like ArrayList. Vector will grow automatically when we keep on adding elements. Vector is synchronized and thread safe... java.util.UUID Example in Java
September 27, 2013
java.util.UUID has been introduced from JDK 1.5. UUID is an immutable class that represents universally unique identifier. The important methods of this class is randomUUID, nameUUIDFromBytes etc... java.util.TreeSet Example in Java
August 27, 2013
java.util.TreeSet implements SortedSet. TreeSet keeps natural ordering of elements and can do ordering on the basis of any given Comparator depending on the constructor used... java.util.TreeMap Java Example
August 24, 2013
java.util.TreeMap implements sorted Map. Sorting is done on key as natural ordering. Comaparator can also be provided to sort according to our requirements. TreeMap uses Red-Black tree algorithm... Java Timer and TimerTask Example
August 24, 2013
In java, java.util.Timer schedule a java.util.TimerTask for respective execution or one time execution. There is only background thread that is used to run all Timer tasks sequentially... StringTokenizer Java Example
August 24, 2013
java.util.StringTokenizer breaks a string into tokens. StringTokenizer takes string and delimiter as arguments. Delimiter can be any charterer... ServiceLoader Java Example
August 24, 2013
A service can be an interface or abstract class. ServiceLoader provides the flexibility to load different implementation of a service. Let's a service is CPService... java.util.Random Example in Java
August 24, 2013
java.util.Random is an utility provided by java to generate pseudorandom numbers and boolean values. Random number has methods as nextInt, nextDouble, nextLong etc... PropertyResourceBundle Java Example
August 24, 2013
java.util.PropertyResourceBundle extends ResourceBundle. ResourceBundle handles the resources for a given key value pair properties. PropertyResourceBundle can be created by InputStream... Iterator Java Example
August 16, 2013
java.util.Iterator iterates the elements in Collection Framework. Iterator has taken the place of Enumeration. Iterator has three elements... Enumeration Java Example
August 16, 2013
java.util.Enumeration interface in java helps to iterate the vector. The class which implements Enumeration can be iterated using Enumeration... Hashtable Java Example
August 16, 2013
Hashtable works on the basis of hashtable. Hashtable maps not null key and value. The object which is being created as key, must implements hashCode() and equals() methods... Example of Stack in Java
June 09, 2013
java.util.Stack behaves as Stack i.e. first in last out. push() and pop() methods are there in Stack. push() method pushes the element at the top of element... Example of SimpleTimeZone in Java
June 09, 2013
java.util.SimpleTimeZone represents TimeZone for GregorianCalendar. The object of SimpleTimeZone is created as new SimpleTimeZone(int rawOffset, String ID)... Example of ResourceBundle in Java
June 09, 2013
java.util.ResourceBundle loads the bundles locale specific. If our program should run the basis of user locale, ResourceBundle should be used. We need to create Resources by extending ListResourceBundle... Example of PropertyPermission in Java
June 09, 2013
java.util.PropertyPermission gives permission to the specified property. The property can be like java.home, os.name etc. And the action can be read and write... Example of Properties in Java
June 09, 2013
java.util.Properties stores key value pair. Properties inherit HashTable, so Properties has the methods of HashTable. Properties are persistent storage of key value pair... Example of Observer and Observable in Java
June 09, 2013
java.util.Observer is an interface and it must be implemented by the class which should be informed by changes in observable class.... Internationalization with Locale in Java
June 09, 2013
java.util.Locale is represents geographical region. Locale is used for internationalization (i18). Locale has the constants for language like Locale.ENGLISH, Locale.FRENCH, Locale.GERMAN etc... Example of LinkedList in Java
June 09, 2013
java.util.LinkedList is the implementation of List. The main feature of LinkedList is that it allows removing and inserting at end, start and end... Example of LinkedHashSet in Java
June 09, 2013
The class which object is being added in the LinkedHashSet must override equals and hashCode to identify duplicate element. To maintain insertion order LinkedHashSet uses doubly-linked list... Example of LinkedHashMap in Java
June 09, 2013
java.util.LinkedHashMap maintains the order in which the elements are added. LinkedHashMap does not maintain the order. Performance of LinkedHashMap is slower than HashMap...
comments powered by Disqus



Home    Core Java    Spring    Hibernate    Jquery    My Computer    News    Forum    Quiz    Interview Q & A     Maven     Eclipse IDE

Copyright ©2014 concretepage.com | All rights reserved |Privacy

Developed by : TechWox Corporation