Skip to content

Category Archives: Java Programs

Vector is a legacy class in Java and is present from Java 1.2 version. It implements the List interface of the Collection framework and is… Read More
The path of two files can be compared lexicographically in Java using java.io.file.compareTo() method. It is useful to raise a Red Flag by the operating… Read More
Here, the task is to check whether the given integer number is positive or negative. Below are some basic properties of a number. If the… Read More
In Java, we can copy the contents of one file to another file. This can be done by the FileInputStream and FileOutputStream classes. FileInputStream Class… Read More
The last modifying date of the file can get through Java using the File class of Java i.e File.LastModified() method. Java File Class The File… Read More
Modifying the date of the file is possible through Java using the File class of Java i.e File.setLastModified() method Java File Class The File class… Read More
The list() method defined in class java.io.File which is used to obtain the list of files and folders(directories) present in the specified directory defined by… Read More
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

Start Your Coding Journey Now!