Java Tutorials


Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere" (WORA), meaning that compiled Java code can run on all platforms that support Java without the need for recompilation. Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of computer architecture. Java is one of the most popular programming languages in use, particularly for client-server web applications, with a reported 9 million developers.

Paradigm: Object-oriented (class-based), structured, imperative, generic, reflective, concurrent

Designed By: James Gosling Developer: Sun Microsystems (now owned by Oracle Corporation)

Filename Extensions: .java, .class, .jar Website: www.oracle.com/java


Secure Random Number Example in Java

In Java programming language, we normally use the Math.random() to generate random number but Math.random() will causes the vulnerability in your application. To generate the cryptographically strong random number, Java provides the View details »

iText API - Underline and Strike-through Example in Java

In this tutorial, we are going to show how you will add an underline to a text and strike-trough a text using iText in Java. View details »

iText API- Roman and Greek List Example

This tutorial will explain about how you will add a Roman and Greek list in pdf document using iText API and Java. View details »

iText API- Add Bullets in Unordered List PDF using Java

In the previous iText tutorials, you have seen how to add ORDERED and UNORDERED list in the PDF document. While creating the UNORDERED list you View details »

iText API- Ordered and Unordered List Example in Java

In this tutorial, we are going to create an ORDERED and UNORDERED list in the PDF document. iText API have List class inside the View details »

iText API‐ Protect PDF Document with Password in Java

In this Java tutorial, we are going to show how you will protect your pdf document with a password using iText API. PdfWriter.setEncryption() method is used to View details »

How to add and rotate Image in PDF using iText and Java

In this example, we are going to show you how to add, rotate and change the position of an image on PDF file using View details »

iText API – Creating table in PDF using Java

In this tutorial, we will discuss how to create a table in the PDF document using iText API. iText is an open source and View details »

Core Java Interview Questions and Answers Part 5

Q: What is static block? A: It is used to initialize the static data member, It is executed before main method at the time of class loading. View details »

Core Java Interview Questions and Answers Part 4

Q: What is an Interface? A: An interface is a collection of abstract methods. A class implements an interface. View details »

Core Java Interview Questions and Answers Part 3

Q: What is finalize() method? A: It is possible to define a method that will be called just before an object's final destruction by the garbage collector. View details »

Core Java Interview Questions and Answers Part 2

Q: What kind of variables a class can consist of?A: A class consist of Local variable, instance variables and class variables. View details »

Core Java Interview Questions and Answers Part 1

Q: What do you know about Java? A: Java is a high-level programming language originally developed by Sun Microsystems and released in 1995. Java runs on a variety of platforms, such as View details »

How to iterate ArrayList in Java

This tutorial will explain about how you can iterate an ArrayList in Java. Initially we always use for loop to iterate any list but in View details »

Send email with attachment in Java using Gmail

In this example we are going to send an email with attachment in Java program via Gmail server. JavaMail API provides the classes like View details »

Example of sending email in Java using Gmail SMTP

This Java tutorial will explain how to send an email through Java program using Gmail server and JavaMail API. JavaMail API provides a platform-independent View details »

How to shuffle list elements in Java

On this page we are going to shuffle or randomize List elements in Java. In this example we are randomize the ArrayList elements. View details »

How to parse nested JSON object in Java

In this Java tutorial we are going to parse/read the nested JSON object using JSON.simple library. To parse the Nested Object, we need to create View details »

How to write JSON object to File in Java

In this Java tutorial, we are going to write JSON objects and JSON Array in a File using Java. To create the JSON file using Java program we need to add View details »

How to parse JSON in Java

In this Java tutorial, we are going to parse the JSON data using java program. To parse the JSON object we need to add some extra jar/library. View details »

How to remove vowels from a string in Java

In this example we are going to remove/eliminate all the vowels from string in Java. In our alphabets we have five vowels i.e. a,e,i,o,u/A,E,I,O,U. View details »

Swap two numbers in Java

On this page we are going to swap the value of two integer. Sometime you need to swap/interchange the value of variable or sometime this question has been asked in interview. View details »

How to get System Information in Java

In this article we will get the system details using Java program. Some time we need we need to display or store the system information in our project. View details »

How to insert line number in file using Java

In this example we are going to show to add Line Number in file using java program. Here we are going to read a simple text file (QuickBrownFox.txt) and write the all the content with line number in new text file(NewQuickBrownFox.txt). View details »

How to Encrypt and Decrypt data in Java

In this tutorial we are going to explain how to Encrypt and Decrypt plain text data in simple way. In this example we are going to user a simple Key to encrypt the data and same Key to decrypt the encrypted data. View details »

How to calculate difference between two dates in Java

On this page we are going to calculate the difference between two dates. Some time we have requirement in our project to process the calculation or update the any page on the differences of date. View details »

How to Read and Write Excel file in Java

In this tutorial we will explain about How to Read and Write Excel file in Java using JExcel API. Doing as step by step first we need to create an excel Workbook and the further step is creating Sheet and adding content into the sheet. View details »

How to Set and Get Thread Name in Java

This Java tutorial will explain how to set and get thread name in Java. Thread class provides two method for handling the thread name. Every thread has a name by default like thread-0, thread-1, and thread-2 and so on. View details »

How to set Priority of Thread in Java

This tutorials will explain the “How to set the priority of Thread in Java”. Every thread has a priority and priority represents the integer number between 1 to 10. View details »

Example of Sleep Method in Java

Thread.sleep method of current thread suspend the execution of program for specific time. This method is generally used for giving the execution time to another Thread. View details »

Methods of Thread class in Java

On this page you will get the list of some frequently used methods in Java Thread class that makes the application simple and reliable. View details »

How to Create Thread in Java

This tutorial will explain how to create a Thread in Java. Thread can be created by two way in Java… View details »

File Handling Example in Java

This tutorials will explain “How to Handle File in Java”. There are many way to handle or manipulate the file in Java. Most of the I/O Streams classes are in the java.io package. View details »

How to Read/Parse XML in Java

In this tutorial we will read the XML file via DOM XML parser using Java program. DOM parser loads the whole XML document into memory. View details »