Google AdSense alternatives comparison

Posted on Posted in SEO

This post provide a comparison between different Adsense alternatives available for content publishers.   Chitika Chitika is supposed to show context sensitive ads. However, i have noticed mostly irrelevant ads. Also, the pay is normally very less for average websites.   Infolinks Infolinks is a good alternative as the ads show up differently. It can […]

Java 8 for loop

Posted on Posted in Core Java, Java 8

For loop in Java has changed a lot from the way it first appeared in jdk 1.   Here is an example of the classical for loop :  

  Java 5 added the forEach loop that made looping with collections easier as it removed declaration of the looping variable and checking length of […]

How to split a string in java

Posted on Posted in Core Java

Here are some approaches to split a String in Java.   Using String.split() method Using StringTokenizer   Splitting a string using the split() method   Here is the syntax of the split() method :   public String[] split(String regex, [int limit])   Here, regex is a regular expression that will act as separator for the […]

Convert String to XML Document and XML Document to String in Java

Posted on Posted in Java

This article provides utility methods to : Convert an xml document object to string Convert a string to xml document object   First let’s create a class StringXMLConversion.java in a package com.techkatak.test.   Now, we need a xml file or string to start with. For this, we can just hardcode the xml string as shown […]

Immutable in Java

Posted on Posted in Core Java

  This articles focuses on the following : What is meant by an Immutable class in Java ? What is the advantage of an Immutable class ? How to create an Immutable class ? What happens when a variable or class is marked final ?   Immutability in Java An object is considered immutable if […]

Binary Search in Java

Posted on Posted in Core Java, Java

This post explains : – Java code for binary search in list – searching lists in java – java code for recursive binary search – java code for iterative binary search   Searching List in Java If a list is not sorted, searching can only be done by element by element by comparison. So, its […]

Reverse a string in java

Posted on Posted in Core Java, Java

If you are looking for the following, this article will be of help : – Reverse a string in Java without library functions – String reversal algorithm in java – Reverse a string using StringBuffer or StringBuilder   Reverse a String in Java   Java provides library methods in StringBuffer and StringBuilder to reverse a […]