Maruthi Krishna has Published 870 Articles

Write program to reverse a String without using reverse() method in Java?

Maruthi Krishna

Maruthi Krishna

Updated on 02-Aug-2019 12:27:11

5K+ Views

You can reverse a String in several ways, without using the reverse() function.Using recursion − Recursion is the process of repeating items in a self-similar way. In programming languages, if a program allows you to call a function inside the same function, then it is called a recursive call of the ... Read More

How to delete folder and sub folders using Java?

Maruthi Krishna

Maruthi Krishna

Updated on 02-Aug-2019 12:13:29

3K+ Views

The class named File of the java.io package represents a file or directory (path names) in the system. This class provides various methods to perform various operations on files/directories.The delete() method of the File class deletes the file/directory represented by the current File object.This ListFiles() method of the File class ... Read More

How to get file last modified time in Java?

Maruthi Krishna

Maruthi Krishna

Updated on 02-Aug-2019 12:01:30

3K+ Views

He class named File of the java.io package represents a file or directory (path names) in the system. This class provides various methods to perform various operations on files/directories.The lastModified() method of the File class returns the last modified time of the file/directory represented by the current File object. You can ... Read More

How to list out the hidden files in a Directory using Java program?

Maruthi Krishna

Maruthi Krishna

Updated on 02-Aug-2019 11:47:25

575 Views

The class named File of the java.io package represents a file or directory (path names) in the system. This class provides various methods to perform various operations on files/directories.The isHidden() method of the File class verifies weather the (abstract path of) file/directory represented by the current File object, is hidden.The ... Read More

How to write a program to copy characters from one file to another in Java?

Maruthi Krishna

Maruthi Krishna

Updated on 02-Aug-2019 11:24:50

3K+ Views

To copy the contents of one file to other character by characterExampleimport java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; public class CopyFiles {    public static void main(String[] args) throws IOException {       //Creating a File object to hold the source file       File source = ... Read More

How to get file URI reference in Java?

Maruthi Krishna

Maruthi Krishna

Updated on 02-Aug-2019 11:21:24

5K+ Views

The class named File of the java.io package represents a file or directory (path names) in the system. This class provides various methods to perform various operations on files/directories.In general, an URI (Uniform Resource Identifier) represents a resource. The URI class of Java represents this format You can get the ... Read More

How to create and store property file dynamically in Java?

Maruthi Krishna

Maruthi Krishna

Updated on 02-Aug-2019 11:18:19

3K+ Views

The .propertiesis an extension in java which is used to store configurable application. It is represented by the Properties class in Java, you can store a properties file and read from it using the methods of this class. This class inherits the HashTable class.Creating a .properties fileTo create a properties ... Read More

How to compress and un-compress the data of a file in Java?

Maruthi Krishna

Maruthi Krishna

Updated on 02-Aug-2019 11:11:37

1K+ Views

Java provides a two classes namely, DeflaterOutputStream and InflaterInputStream for compressing and uncompressing data.Compressing a Single fileTo compress a single file −Create a FileInputStream object, by passing the path of the file to be compressed in String format, as a parameter to its constructor.Create a FileOutputStream object, by passing the ... Read More

How to filter the files by file extensions and show the file names in Java?

Maruthi Krishna

Maruthi Krishna

Updated on 02-Aug-2019 11:06:45

3K+ Views

The class named File of the java.io package represents a file or directory (path names) in the system. This class provides various methods to perform various operations on files/directories.To get the list of all the existing files in a directory this class provides five different methods to get the details of ... Read More

How many ways can we read data from the keyboard in Java?

Maruthi Krishna

Maruthi Krishna

Updated on 01-Aug-2019 14:27:57

5K+ Views

The java.io package provides various classes to read write data from various sources and destinations.You can read data from user (keyboard) using various classes such as, Scanner, BufferedReader, InputStreamReader, Console etc.Using Scanner classFrom Java 1.5 Scanner class was introduced. This class accepts a File, InputStream, Path and, String objects, reads ... Read More

Advertisements