Skip to content

Category Archives: Java Programs

The size of files in Java can be obtained using the File class. The in-built function of ‘fileName.length()’ is used to find size of file… Read More
List in Java contains index-based methods. This enables us to maintain the order collection. So this enables us to search, insert, delete, and even update… Read More
Prerequisite: Vectors in Java Why We Use Vector? Till now, we have learned two ways for declaring either with a fixed size of array or… Read More
A directory is an organizational file system structure that contains Files and Directorates. Even an attacker can try to traverse or access a folder which… Read More
Hangman is a popular word guessing game where the player endeavors to construct a lost word by speculating one letter at a time. After a… Read More
Given an array of integers, print the sum of all the elements in an array. Examples: Input: arr[] = {1,2,3,4,5} Output: 15 Input: arr[] =… Read More
The Stack is a linear data structure that follows the LIFO(Last In First Out) principle, i.e, the element inserted at the last is the element… Read More
Searching files in Java can be performed using the File class and FilenameFilter interface. The FilenameFilter interface is used to filter files from the list… Read More
In Java sorting and searching an element in an array is very easy. Unlike C, where we have to make all the functions to work,… Read More
Sorting an array can be done by using inbuilt sort function while for the insertion we have to create a new array to do so… Read More
In java, the arrays are immutable i.e if the array is once assigned or instantiated the memory allocated for the array can’t be decreased or… Read More
Given a Collection in Java, the task is to find the length or size of the collection. Examples: Input: Array_List: [1, 2, 3,4] Output: 4… Read More
The regionMatches() method of the String class has two variants that can be used to test if two string regions are matching or equal. There… Read More
Given two arrays, the task is to merge or concatenate them and store the result into another array. Examples: Input: arr1[] = { 1, 3,… Read More
Given two given arrays of equal length, the task is to find if given arrays are equal or not. Two arrays are said to be… Read More

Start Your Coding Journey Now!