Base64 String Encoding in Java

Base64 is encoding scheme that can represent binary data in ASCII string format. This is useful whenever arbitrary data needs to be passed across systems as textual data. This ensures that binary data which may have special meaning to the transport layer remains intact during transport. Encoding and storing image binary data as an XML […]

Find Largest Number in an Array Using Java

The following Java program finds the largest number in a given array. Initially the largest variable value is set as the smallest integer value (Integer.MIN_VALUE) and whenever a bigger number is found in array, it is overwritten with the new value. We iterate through the entire array with the above logic to find the largest […]

Java Program to Print All Alphabets

The following Java program prints all alphabets in English language. This program uses the Java character variable and built-in ordering of the character variable values. The following program prints both capital letters and small letters. Write a Java Program to Print All English Alphabets // Java program to print all english alphabets public class AllAlphabets […]

Java Program to Find Area of a Circle

The formula for finding area of a circle is, area = PI * radius * radius Where PI is a constant (approximately 3.1416) and radius is the radius of the circle. Calculate Area of a Circle in Java The following Java program calculates the area of a circle given the radius of the circle. This […]

Find Area of a Rectangle in Java

The formula for finding the area of a rectangle is, area = length * width Calculate Area of a Rectangle in Java The following program calculates area of a rectangle in Java. The program asks the user for length and width values and then outputs the result in the console. We use BufferedReader to read […]