Transform XML with XSTL using Java

XML and XSLT makes data exchange and rendering of the data in various formats easier. XML is pretty good for portable data exchanges, well structured data formats and helps in open standards. XSLT on the other hand can transform the XML to other formats. For… Read More

Sending Email using javax.mail API

The JavaMail standard extension in package javax.mail and javax.mail.internet (the latter contains classes that are specific to Internet email protocols) provides classes to send emails. Let us consider the example of how to send mail using the SMTP protocol. Example : Send Mail using SMTP… Read More

Compute logarithms using Java

This post is about calculating logarithms using Java. Java provides supports for logarithms via the java.lang.Math package, the log() function.This function is to the base e.Base e or the natural logarithm represent the log to a constant (e) whose value is approximately 2.718281828. To compute… Read More

How To Create Custom Annotations In Java

This tutorial is about creating custom annotations in Java. Ever since Java started supporting annotations, most of the frameworks embraced annotations and now annotations are the best way to define the extra services that a class requires. Much cleaner and easier than XML or properties… Read More

Usage of Ciel and Floor in Java

Java Math package provides the ciel(double d)  and floor(double d) functions. The ciel function is used to get the smallest integer that is not less than the input. Obviously this means the ciel will round it to the next higher non decimal number. For example… Read More

How to concatenate String in Java

In java we can concatenate string using the concat method of the java.lang.String class. Concat method appends the input string to the current string and returns the combined string. package com.javahash.strings; public class StringMethods { /** * @param args */ public static void main(String[] args)… Read More