Java Zip and Unzip Files and Folders

Here we will learn about how to zip and unzip files and folders in java. If information contains redundant data it will be tough to store and transfer the data. So we will go for compression which will give efficient representation of the data. For zipping many algorithms are there. Java provides the java.util.zip package for zipping and unzipping the files. The class ZipOutputStream will be useful for compressing. It is an output stream filter which will write files to

Read more

Spring Architecture – Spring Modules

In this tutorial we will take a look on spring architecture and various spring modules. Spring Framework is organized into 20 modules which are arranges in 6 groups as listed below. Core Container Aspect Oriented Programming Instrumentation Web Data Access/Integration Test Lets discuss each of them in brief. Spring Architecture and Spring Modules Image Source Core Container Spring core container is the basis for the complete Spring framework. It provides an implementation for IoC that supports dependency injection. This provides

Read more

Spring Hello World Example

In this tutorial you will learn to create Spring hello world example. I used Spring 4 in this project but the process is same for any other spring version. Before starting the tutorial make sure you have eclipse and jdk on your system. Spring Hello World Example Step 1: Create Java Project Open eclipse ide and create a java project with any name, here I am creating the project with name SpringHelloWorld. You can create the project by going to

Read more

Error could not find or load main class in Eclipse – 3 Ways to Fix

In this tutorial you will learn about the error could not find or load main class in eclipse and the ways that could solve this error. When class loader is unable to load the main class of our application then this error will come. Many reasons are there for this has to be happen. Ways to Fix Error could not find or load main class in Eclipse 1. If Path is Incorrectly Specified This error will come mainly due to

Read more

java.lang.IllegalArgumentException – Reasons and How to Solve?

Here you will learn possible causes of Exception in thread “main” java.lang.IllegalArgumentException and ways to solve it. I hope you know the difference between error and exception. Error means programming mistake that can be recoverable only by fixing the application code. But exceptions will arise only when exceptional situations occurred like invalid inputs, null values, etc. They can be handled using try catch blocks. java.lang.IllegalArgumentException will raise when invalid inputs passed to the method. This is most frequent exception in java.

Read more

Java Program to Find GCD of Two Numbers Using Euclidean Algorithm

Here you will get java program to find gcd of two numbers using recursion and euclidean algorithm. Greatest Common Division (GCD) of two numbers is largest number that divides both of them completely. GCD is also called as Highest Common Factor (HCF). There are various ways to find GCD but Euclidean Algorithm is the most efficient way. Euclid’s algorithm GCD of two numbers a and b can be obtained by following algorithm. gcd (a, b) = gcd (a – b, b),

Read more

Difference between Statement and PreparedStatement in Java

Here you will learn about difference between statement and preparedstatement in Java i.e. Statement vs PreparedStatement. The Java Database Connectivity (JDBC) API is essentially used to connect Java applications with databases. It could be any relational or OLAP database. The JDBC API offers different interfaces to connect to particular databases and execute numerous types of SQL queries such as follows: Statement PreparedStatement These JDBC interfaces offers different functionalities, properties and methods which enables us to connect to databases and execute

Read more
1 2 3 4 5 15