Breaking News
Home / Java / Java Tutorials (page 3)

Java Tutorials

How to construct DOM and convert to XML?

  Constructing DOM (Document Object Model) to generate or represent XML is easy. The basic steps are as follows > Create the XML Document  object using the Document Builder Factory. >Build your model by adding nodes and attributes etc. in the hierarchical order > Once done, transform your XML Document …

Read More »

Understanding Java Classloaders

Java Classloader

When a program is launched by the JVM via the main(String args[]) method, the JVM loads the main Class and then all the classes that are referenced from there on. This is done via the help for Classloaders. Interesting there are a variety of classloaders that are created by the …

Read More »

Build a simple Stop Watch Timer

StopWatch

At times we need to know how much time is taken to do a Task? This task can be any unit of work e.g. a method, a few lines of code, a long running code etc. This can be helpful to understand time taken to do a Task and tune …

Read More »

How to extract a zipped file using Java?

Building a Zip utility like Winzip is easy in Java, similarly building a unzip tool is easy too,  thanks to java.util.zip package. Basically in this case we need to open a ZipInputStream to reference the zipped file that we want to extract. Then loop through all the ZipEntry defined in …

Read More »

How to zip folder using Java?

Building a utility like Winzip is easy in Java, thanks to java.util.zip package. Basically we need to open a ZipOutputStream which is created on top of FileOutputStream, then loop through all the files in the folder. While looping, get the handle each of the file using FileInputStream and create a …

Read More »
Advertisment ad adsense adlogger