Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

JAVA Web Frameworks Spring MVC, JSF, Grails, Struts 2, GWT - Pros and Cons

  Undoubtedly Java is the most demanded programming languages in the world today. A JS framework provides a solid foundation on which a programmer can build programs. It includes predefined classes and functions that are used to manag...

Java 8 Vs Java 9 : Comparing the Enhanced Features of Interface

  Java 8 came with the enhanced functionality to the Interfaces. Prior to Java 8, interfaces were contracted only with the abstract methods and subclass was obliged to implement the contract. Child class has to implement the abstract ...

Java - How to Fix or Avoid Incompatible Types Possible Lossy Conversion Error?

In this blog, we will see why we get an error while we perform any arithmetic operations on two operands with type byte or short. we find the following error while compiling the source code in Java. In the case of type short: Let say we add tw...

How to Use Javadoc tool to create documentation API

Creating a documentation of a Java source file is not a big task, it can be done in just 3 steps which are explained below. We use Javadoc tool to create documentation API for a java source file. Let's create a file with class name Documen...

Different ways of writing main method in Java

Here we will learn different ways in which we can write the main method in JAVA. Different ways of modifying the main method in JAVA are mentioned below and displayed with the help of example: 1) Making changes in the sequence of modifiers, me...

How to Add Elements, Increase Size & Capacity of a Vector Class in JAVA Collection Framework

In this blog we will understand about Vector Class in Collection Framework. We use vector class to facilitate the growable nature of collection of objects. Like array we can access any member of the collection using the integer index. The size of...

Instantiating and Manipulating LinkedList in Java with Examples

  Introduction:   In this blog we will learn about LinkedList.In general terms, LinkedList is a data structure where each element consist of three parts. First part represents the link to the previous element, second part r...

List of Best Tutorial Sites to Learn JAVA for Complete Beginners

  There are lots of on line resources that can be very helpful in learning Java programming language. Here I am mentioning some good sites that will help the learners, who are starting from scratch. Well it's very much required th...

How to iterate over elements of ArrayList in java

In this blog we will learn how to iterate over the elements of a collection (here we considered ArrayList) using generics and without generics. First we will go through the process of using iterator method. Iterator() method is included by eve...

Instantiating and Manipulating ArrayList in Java

In this blog we will learn about ArrayList. ArrayList is one of the collection class of collection framework. It is a way of storing elements dynamically in an array. It implements the List interface and extends the AbstractList class. Important ...

Collection Framework and Interface in Java

In java “Collections” helps us to store and manipulate the collection of objects. All the operations such as manipulation, deletion, searching, sorting, insertion can be performed quickly with the help of “Collections”. Ja...

Thread and instantiating thread in java

In this blog we will learn about importance of Thread class in java and instantiating thread. Every java program consists at least one thread i.e. the main thread. The Java Virtual Machine always creates a main thread and calls the main method in...

Array and it's type in java

In this blog we will learn about array and it's type in Java. Array is defined as a collection of similar type of elements.          Array are seen as a collection of elements these elements belongs ...

Generate Simple PDF using iText

Generate Simple PDF using iText: Some time we need to generate documents using our application. The document could be like pdf, word, excel etc. To generate these documents we need to take help of third party api. In this article we talk about...

What is singleton pattern and double checked locking ?

Singleton pattern is basically used to maintain only a single object of a class in the application. This uses private constructor and static method to return class instance like this : public class SingleTon { private static Singl...

What is Abstract factory pattern with example?

We know that factory pattern provides single level abstraction and used to create object easily but in a case of more security, we can use one more level of abstraction by using the abstract factory pattern. we can say that this provides factory ...

What is Factory Pattern?

Factory pattern is one of the most used design patterns in java with the help of this pattern you can create object easily by using this concept of oops. Example of Factory pattern : 1. Create an interface 2. Create class that 'll ov...

Arraylist vs Vector

Basic difference between the two is the Synchronization. Vector is Synchronized and Arraylist is not. If your application will  be having single thread of execution use Arraylist else Vector. ArrayList is fast because its not synchronized...

Integrate Apache2 and Tomcat 7 Using mod_jk

As we know our most of the projects in Java is run using Tomacat application server. Sometimes we also need some web server like apache2 for other functionalities like wordpress integration. In such situation our project need both of the server ...

Multiple Inheritance in Java with Example

Hello!! As we know that java does not support the multiple inheritance but java 8 provides a way by which we can use multiple inheritance. It provides a default method to do this job. In java 7, interface are used to declare the contra...

How to read a text file using Scanner in Java?

Hello!! As we know that their are multiple way to read the text file in java. BufferedReader class is generally uses to read the text file. FileReader, BufferedReader, FileInputStream is used to reade the text file in java ...

Regular Expression in Java

Hello!! Regular Expression is part of the Automata, and also called rational expression. We use it for finding the match of the string like validating the Email address, Password etc. It uses some special sequence of the character for mat...

Travelling Salesman Problem

Hello!!! Travelling Salesman Problem is for finding the shortest possible root that visit every node in the graph and return to the origin point. It is used to find the shortest path. For example:- In this graph, Their is many way to rea...

How to Print All Leaf Node of Binary Tree

Hello Everyone!!!   In order to solve binary tree problem of leaf node, we should know that what is leaf node? Leaf node is node of the binary tree whose have no left and right child means whose left and right child is null. It...

Concatenate two arrays in Java

Concatenate two arrays in Java is quite simple you can use single liner solution from the Apache Commons Lang library.   ArrayUtils.addAll(T[], T...) For example if you have two array firstArray and secondArray, you would have code ...

java.io.FileNotFoundException: the system cannot find the file specified

If you face following error: "java.io.FileNotFoundException: the system cannot find the file specified" and error similar to below is visible in logs: Exception in thread "main" java.io.FileNotFoundException: Report.PDF (The s...

How to make https to Dropbox Redirect URL

Hello Guys, As Dropbox was not allowing HTTP URL's for callback or redirect URL's (as http was only allowed for localhost). I added below redirect URI in dropbox App for local machine : http://localhost:8080/DropboxTest/oauth_c...

Use of stream instead of for loop in java 8

We all know about the use of For loop and for each loop that is used to iterate all elements in list or collection but some time in case of n numbers of items loop traverse till nth item that is time consuming but after java 8 we have some strong...

Default methods and static methods uses in Interface.

We know that interface provide methods without body or functionality but in abstract class we can provide default functionality of methods. So in interface we can't give method body and can't declare ant static method. But in Java 8 no...

Tower of Hanoi Implementation in Java

Hi Readers, In this blog i will provide you the Java solution for the famous Tower of Hanoi problem using Stack. Problem definition Tower of Hanoi is a mathematical puzzle. It is also known as Tower of Brahma or Locus' Tower. Th...

Insertion sort implementation in Java

Hi Readers, This blog is to help you to understand how insertion sort works. Insertion sort is a simple sorting algorithm which is good to sort short list. Real life example of insertion sort is sorting of playing cards, Like we pick a card...

Fisher-Yates Algorithm for Array Shuffling

Hi there, Here in this blog I am going to provide Java implementation of Fisher-Yates Algorithm for array shuffling. Fisher–Yates shuffle algorithm as named after Ronald Fisher and Frank Yates. It is also known as Knuth sh...

Taking a screenshot of screen using Java and save it in image format

Hello there, In this blog I will provide a solution to how you can get screenshot of your screen and then save it at any location of your choice for this, we will use java.awt.Robot for creating an image which will generated by readi...

Adding watermark to your PDF using Java

Hi there, In this blog we will see how to add watermark images to our PDF files using Java.  Watermarks have been used to discourage counterfeiting. To generate watermarked PDFs we need an additional itext.jar file to be in...

Getting OS-level system information using Java

Hello readers, Here below is a small Java program to extract information such as the current disk space used, CPU utilisation and memory used in the underlying OS. To get information related to the disk usage you can also use java.io.File clas...

Read CSV data using Java

Hello In this blog I will give a demo about how to read CSV data from a file. For this purpose I will use Opencsv library. Opencsv  is a very simple csv (comma-separated values) parser library for Java. You can download  the binar...

Counting Sort

Hi, This blog is to help you to understand counting sort in easiest manner, counting sort can sort the range in linear time but we have to provide the starting element and last highest element of the range (means elements in the rang...

PDF generation using Apache FOP

Hello readers,       This blog is to help you to learn how to generate PDF using Apache's FOP in Java. Apache FOP ( Formatting Object Processor ) which uses XSL-FO to create PDF file of our document. Here is a s...

Sorting JSONArray in java

Hello Guys     Here, I am writing the code for sorting JSONArray in java technology. we can sort jsonarray in ascending or in descending order according to our requirement by changing pattern as below.   private stat...

Sieve of Eratosthenes

Hello, This blog is to help you to understand Sieve of Eratosthenes algorithm for prime number generation in easiest way. This algorithm is to calculate the prime number up to a limit with lesser time complexity, but it takes O(n) extra s...

Comparator Interface in Java

Comparator:- Comparator interface  found in java.util package and it contains equals() and compare() method. It use the multiple sorting technique to write our own comparison logic and is used to sort the e...

Interesting fact about AND and OR operator

Hello readers,  I want to share an interesting fact about AND and OR operator, which you might not had encountered. As we know that in AND operator the result is only true when the values of the operands are true, if any of the opera...

Comparable Interface in Java

Comparable:- Comparable interface  found in java.lang package and it contains only compareTo() method. It use the single sorting technique to write our own comparison logic and is used to sort the elements on the basis of...

Apache HBase Installation in Standalone mode on Ubuntu

Hi there, Apache HBase can be installed in the following three modes : Standalone mode Pseudo Distributed mode Fully Distributed mode This blog is to setup HBase in standalone mode on your Ubuntu machine without any hassle. You ...

Try block without catch and finally (Try with Resource)

 Try-with-Resource:- Hello Friends, before Java 7, we need to use Catch or finally block with the Try Block in Java.  But In Java 7, we use Try block with resource, through which we can use the Try Block without catch or finally block. ...

File handling basics in Java

Hi there, This blog is to get you familiarize with Java file handling using java.io package. Suppose you need to read the content of your file and need to do operation on that data, in that situation you can opt to use file handling to access ...

Java 8 Date Time Api

Date Time Api in Java 8: Java 8 introduce with new Date Time API. which is much simpler than the old date time api and reduce the overheads faces in the old api  some of the changes are describe below in new date time api. 1. LocalDate/Lo...

How to encrypt password using SHA algorithm ?

Create a strong encrypted password in Java : In almost every application we need to create a strong encrypted password. There are many encryption algorithms to create password. It is good approach to have a strong salt and on the basis of that sa...

Apache Zookeeper installation in Ubuntu for Standalone mode

Hi there, This blog is to help you for Apache Zookeeper installation on your local Ubuntu machine. Apache Zookeeper is used to develop and maintain an open-source server which provides highly reliable distributed coordination.  ...

0/1 Knapsack Solution in Java

Hi, this blog is to help you to know about 0/1 knapsack problem and how to solve it using Java.   Problem Definition Suppose there is a thief who came to steal thing from someone's home. He has a knapsack(shoulder bag) ...
prev 1 3 13
Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: