javaio
javaio
Java uses the concept of a stream to make I/O operation fast. The java.io package contains all the
classes required for input and output operations.
We can perform file handling in Java by Java I/O API.
Core Concepts of Java I/O
Java I/O revolves around two primary concepts: streams and readers/writers.
Streams: Streams represent a sequence of data. In Java, there are two types of streams: input
streams and output streams. Input streams are used to read data from a source, while output
streams are used to write data to a destination. Streams can be categorized into byte streams
(InputStream and OutputStream) and character streams (Reader and Writer).
Readers/Writers: Readers and writers are specialized stream classes designed for handling
character data. They provide a convenient way to read from and write to character-based data
sources. Readers read character data from input streams, while writers write character data to
output streams.
Stream
A stream is a sequence of data. In Java, a stream is composed of bytes. It's called a stream
because it is like a stream of water that continues to flow.
In Java, 3 streams are created for us automatically. All these streams are attached with the
console.
1) System. Out: standard output stream
2) System.in: standard input stream
3) System. Err: standard error stream
Let's see the code to print output and an error message to the console.
1. System.out.println("simple message");
2. System.err.println("error message");
Let's see the code to get input from console.
1. int i=System.in.read();//returns ASCII code of 1st character
2. System.out.println((char)i);//will print the character
1
OutputStream
Java application uses an output stream to write data to a destination; it may be a file, an array,
peripheral device or socket.
InputStream
Java application uses an input stream to read data from a source; it may be a file, an array,
peripheral device or socket.
Let's understand the working of Java OutputStream and InputStream class by the figure given
below.
OutputStream Class
OutputStream class is an abstract class. It is the superclass of all classes representing an output
stream of bytes. An output stream accepts output bytes and sends them to some sink.
Useful Methods of OutputStream Class
Method Description
public void write(int) throws IOException It is used to write a byte to the current output
stream.
public void write(byte[])throws IOException It is used to write an array of byte to the current
output stream.
public void flush() throws IOException It flushes the current output stream.
public void close() throws IOException It is used to close the current output stream.
OutputStream Hierarchy
2
InputStream Class
InputStream class is an abstract class. It is the superclass of all classes representing an input
stream of bytes.
Useful Methods of InputStream Class
Method Description
public abstract int read() throws IOException It reads the next byte of data from the input
stream. It returns -1 at the end of the file.
public int available() throws IOException It returns an estimate of the number of bytes that
can be read from the current input stream.
public void close() throws IOException It is used to close the current input stream.
InputStream Hierarchy
3
Java I/O Classes
1. Java provides a rich set of classes for performing I/O operations. Some of the key classes
include:
2. InputStream and OutputStream: These abstract classes form the foundation for byte-
oriented I/O operations. They provide methods for reading and writing bytes from/to
various sources and destinations.
3. Reader and Writer: These abstract classes are used for character-based I/O operations.
They provide methods for reading and writing characters from/to character-based
streams.
4. FileInputStream and FileOutputStream: These classes allow reading from and writing
to files in a byte-oriented manner.
5. FileReader and FileWriter: These classes enable reading from and writing to files using
character-oriented operations.
6. BufferedInputStream and BufferedOutputStream: These classes provide buffering
capabilities, which can significantly improve I/O performance by reducing the number of
system calls.
7. BufferedReader and BufferedWriter: These classes offer buffered reading and writing
of character data, enhancing I/O efficiency when working with character-based streams.
Practical Applications of Java I/O
Java I/O is employed in various real-world scenarios, including:
1. File Handling: Java I/O is extensively used for reading from and writing to files.
Developers can manipulate files, create directories, and perform file-related operations
using Java's file I/O classes.
2. Network Communication: Java's socket classes (Socket and ServerSocket) facilitate
network communication by enabling data exchange between client and server
applications over TCP/IP.
3. Serialization: Java's serialization mechanism allows objects to be converted into a
stream of bytes for storage or transmission. It is particularly useful for storing object state
or transferring objects between applications.
4. Data Processing: Java I/O is integral to data processing tasks such as parsing text files,
processing CSV data, and interacting with databases through JDBC (Java Database
Connectivity).
Best Practices for Java I/O
When working with Java I/O, consider the following best practices:
4
1. Use Try-with-Resources: Always use the try-with-resources statement when working
with streams to ensure proper resource management. This automatically closes the
streams when they are no longer needed, preventing resource leaks.
2. Use Buffered I/O: Whenever possible, use buffered I/O classes to minimize the number
of system calls and improve performance.
3. Handle Exceptions Gracefully: Handle I/O exceptions gracefully by implementing error
handling mechanisms such as logging or error propagation.
4. Use NIO for Performance: For high-performance I/O operations, consider using Java's
NIO (New I/O) package, which provides non-blocking I/O features and enhanced
performance.
Java FileOutputStream Class
Java FileOutputStream is an output stream used for writing data to a file.
If you have to write primitive values into a file, use FileOutputStream class. You can write byte-
oriented as well as character-oriented data through FileOutputStream class. But, for character-
oriented data, it is preferred to use FileWriter than FileOutputStream.
Method Description
void write(int b) It is used to write the specified byte to the file output
5
stream.
Output:
Success...
The content of a text file testout.txt is set with the data A.
testout.txt
A
Java FileInputStream Class
Java FileInputStream class obtains input bytes from a file. It is used for reading byte-oriented
data (streams of raw bytes) such as image data, audio, video etc. You can also read character-
stream data. But, for reading streams of characters, it is recommended to use FileReader class.
6
Java FileInputStream Class Declaration
Let's see the declaration for java.io.FileInputStream class:
1. public class FileInputStream extends InputStream
Java FileInputStream Class Methods
Method Description
int available() It is used to return the estimated number of bytes that
can be read from the input stream.
int read() It is used to read the byte of data from the input
stream.
int read(byte[] b) It is used to read up to b.length bytes of data from the
input stream.
int read(byte[] b, int off, int len) It is used to read up to len bytes of data from the input
stream.
long skip(long x) It is used to skip over and discards x bytes of data
from the input stream.
FileChannel getChannel() It is used to return the unique FileChannel object
associated with the file input stream.
FileDescriptor getFD() It is used to return the FileDescriptor object.
protected void finalize() It is used to ensure that the close method is call when
there is no more reference to the file input stream.
void close() It is used to closes the stream.
Java FileInputStream Example 1: Read Single Character
File Name: DataStreamExample.java
1. import java.io.FileInputStream;
2. public class DataStreamExample {
3. public static void main(String args[]){
4. try{
5. FileInputStream fin=new FileInputStream("D:\\testout.txt");
6. int i=fin.read();
7. System.out.print((char)i);
7
8.
9. fin.close();
10. }catch(Exception e){System.out.println(e);}
11. }
12. }
Note: Before running the code, a text file named as "testout.txt" is required to be created. In
this file, we have written the following content in the file:
Welcome to javatpoint.
After executing the above program, we will get a single character from the file which is 87 (in
byte form). To see the text, we need to convert it into character.
Output:
W
FileInputStream Class Constructors
The FileInputStream class in Java provides several constructors to create a FileInputStream
instance, allowing us to read bytes from a file in various ways. Here is an overview of the
constructors available in the FileInputStream class:
1. FileInputStream(String name)
It creates a FileInputStream by opening a connection to an actual file, the file named by the
path name name in the file system.
o Parameters: name - the name of the file.
o Throws FileNotFoundException if the file does not exist, is a directory rather than a
regular file, or for some other reason, cannot be opened for reading.
2. FileInputStream(File file)
It creates a FileInputStream by opening a connection to an actual file represented by
a File object.
o Parameters: file - the File object that represents the file to be opened.
o Throws FileNotFoundException if the file does not exist, is a directory rather than a
regular file, or for some other reason, cannot be opened for reading.
3. FileInputStream(FileDescriptor fdObj)
8
It creates a FileInputStream by using a file descriptor fdObj that represents an existing
connection to an actual file in the file system.
o Parameters: fdObj - the file descriptor.
o Note: It is useful when we have a FileDescriptor for a file, perhaps obtained from
another file system operation or as part of inter-process communication.
Java BufferedOutputStream Class
Java BufferedOutputStream class is used for buffering an output stream. It internally uses buffer
to store data. It adds more efficiency than to write data directly into a stream. So, it makes the
performance fast.
For adding the buffer in an OutputStream, use the BufferedOutputStream class. Let's see the
syntax for adding the buffer in an OutputStream:
1. OutputStream os= new BufferedOutputStream(new FileOutputStream("D:\\IO Package\\
testout.txt"));
Java BufferedOutputStream class declaration
Let's see the declaration for Java.io.BufferedOutputStream class:
1. public class BufferedOutputStream extends FilterOutputStream
9
offset
void flush() It flushes the buffered output stream.
Example of BufferedOutputStream class:
In this example, we are writing the textual information in the BufferedOutputStream object
which is connected to the FileOutputStream object. The flush() flushes the data of one stream
and send it into another. It is required if you have connected the one stream with another.
1. package com.javatpoint;
2. import java.io.*;
3. public class BufferedOutputStreamExample{
4. public static void main(String args[])throws Exception{
5. FileOutputStream fout=new FileOutputStream("D:\\testout.txt");
6. BufferedOutputStream bout=new BufferedOutputStream(fout);
7. String s="Welcome to javaTpoint.";
8. byte b[]=s.getBytes();
9. bout.write(b);
10. bout.flush();
11. bout.close();
12. fout.close();
13. System.out.println("success");
14. }
15. }
Output:
Success
testout.txt
Welcome to javaTpoint.
Java BufferedInputStream Class
Java BufferedInputStream class is used to read information from stream. It internally uses buffer
mechanism to make the performance fast.
The important points about BufferedInputStream are:
10
o When the bytes from the stream are skipped or read, the internal buffer automatically
refilled from the contained input stream, many bytes at a time.
o When a BufferedInputStream is created, an internal buffer array is created.
11
reset methods.
12
Java SequenceInputStream Class
Java SequenceInputStream class is used to read data from multiple streams. It reads data
sequentially (one by one).
Java SequenceInputStream Class declaration
Let's see the declaration for Java.io.SequenceInputStream class:
1. public class SequenceInputStream extends InputStream
Constructors of SequenceInputStream class
Constructor Description
SequenceInputStream(InputStream s1, creates a new input stream by reading the data of two
InputStream s2) input stream in order, first s1 and then s2.
SequenceInputStream(Enumeration e) creates a new input stream by reading the data of an
enumeration whose type is InputStream.
Method Description
int read() It is used to read the next byte of data from the input
stream.
int read(byte[] ary, int off, int len) It is used to read len bytes of data from the input
stream into the array of bytes.
int available() It is used to return the maximum number of byte
that can be read from an input stream.
void close() It is used to close the input stream.
Methods of SequenceInputStream class
Java SequenceInputStream Example
In this example, we are printing the data of two files testin.txt and testout.txt.
1. package com.javatpoint;
2.
3. import java.io.*;
4. class InputStreamExample {
5. public static void main(String args[])throws Exception{
13
6. FileInputStream input1=new FileInputStream("D:\\testin.txt");
7. FileInputStream input2=new FileInputStream("D:\\testout.txt");
8. SequenceInputStream inst=new SequenceInputStream(input1, input2);
9. int j;
10. while((j=inst.read())!=-1){
11. System.out.print((char)j);
12. }
13. inst.close();
14. input1.close();
15. input2.close();
16. }
17. }
Here, we are assuming that you have two files: testin.txt and testout.txt which have following
information:
testin.txt:
Welcome to Java IO Programming.
testout.txt:
It is the example of Java SequenceInputStream class.
After executing the program, you will get following output:
Output:
Welcome to Java IO Programming. It is the example of Java SequenceInputStream class.
Java ByteArrayOutputStream Class
Java ByteArrayOutputStream class is used to write common data into multiple files. In this
stream, the data is written into a byte array which can be written to multiple streams later.
The ByteArrayOutputStream holds a copy of data and forwards it to multiple streams.
The buffer of ByteArrayOutputStream automatically grows according to data.
14
1. public class ByteArrayOutputStream extends OutputStream
15
1. package com.javatpoint;
2. import java.io.*;
3. public class DataStreamExample {
4. public static void main(String args[])throws Exception{
5. FileOutputStream fout1=new FileOutputStream("D:\\f1.txt");
6. FileOutputStream fout2=new FileOutputStream("D:\\f2.txt");
7.
8. ByteArrayOutputStream bout=new ByteArrayOutputStream();
9. bout.write(65);
10. bout.writeTo(fout1);
11. bout.writeTo(fout2);
12.
13. bout.flush();
14. bout.close();//has no effect
15. System.out.println("Success...");
16. }
17. }
Output:
Success...
f1.txt:
A
f2.txt:
A
16
Java ByteArrayInputStream Class
The ByteArrayInputStream is composed of two words: ByteArray and InputStream. As the name
suggests, it can be used to read byte array as input stream.
Java ByteArrayInputStream class contains an internal buffer which is used to read byte array as
stream. In this stream, the data is read from a byte array.
The buffer of ByteArrayInputStream automatically grows according to data.
17
int available() It is used to return the number of remaining bytes that
can be read from the input stream.
int read() It is used to read the next byte of data from the input
stream.
int read(byte[] ary, int off, int len) It is used to read up to len bytes of data from an array
of bytes in the input stream.
boolean markSupported() It is used to test the input stream for mark and reset
method.
long skip(long x) It is used to skip the x bytes of input from the input
stream.
void mark(int readAheadLimit) It is used to set the current marked position in the
stream.
void reset() It is used to reset the buffer of a byte array.
void close() It is used for closing a ByteArrayInputStream.
Example of Java ByteArrayInputStream
Let's see a simple example of java ByteArrayInputStream class to read byte array as input
stream.
1. package com.javatpoint;
2. import java.io.*;
3. public class ReadExample {
4. public static void main(String[] args) throws IOException {
5. byte[] buf = { 35, 36, 37, 38 };
6. // Create the new byte array input stream
7. ByteArrayInputStream byt = new ByteArrayInputStream(buf);
8. int k = 0;
9. while ((k = byt.read()) != -1) {
10. //Conversion of a byte into character
11. char ch = (char) k;
12. System.out.println("ASCII value of Character is:" + k + "; Special character is: " + ch
);
13. }
18
14. }
15. }
Output:
ASCII value of Character is:35; Special character is: #
ASCII value of Character is:36; Special character is: $
ASCII value of Character is:37; Special character is: %
ASCII value of Character is:38; Special character is: &
Java BufferedReader Class
Among the many tools available within Java's extensive standard library, the BufferedReader
class stands out as a versatile and efficient means of reading character input from various
sources. Java BufferedReader class is used to read the text from a character-based input stream.
It can be used to read data line by line by readLine() method. It makes the performance fast. It
inherits the Reader class.
Java BufferedReader Class Declaration
The BufferedReader class, part of Java's java.io package, provides a convenient way to read text
from an input stream. It extends the abstract class Reader and offers additional functionality for
buffering input, making it particularly suitable for scenarios where reading character data is
required, such as parsing text files or processing network communication.
Let's see the declaration for Java.io.BufferedReader class:
1. public class BufferedReader extends Reader
Java BufferedReader Class Constructors
Constructor Description
BufferedReader(Reader rd) It is used to create a buffered character input
stream that uses the default size for an input
buffer.
BufferedReader(Reader rd, int size) It is used to create a buffered character input
stream that uses the specified size for an input
buffer.
Java BufferedReader Class Methods
Method Description
int read() It is used for reading a single character.
int read(char[] cbuf, int off, int len) It is used for reading characters into a portion of
19
an array.
boolean markSupported() It is used to test the input stream support for the
mark and reset method.
String readLine() It is used for reading a line of text.
boolean ready() It is used to test whether the input stream is ready
to be read.
long skip(long n) It is used for skipping the characters.
void reset() It repositions the stream at a position the mark
method was last called on this input stream.
void mark(int readAheadLimit) It is used for marking the present position in a
stream.
void close() It closes the input stream and releases any of the
system resources associated with the stream.
Java BufferedReader Example
In this example, we are reading the data from the text file testout.txt using Java BufferedReader
class.
BufferedReaderExample.java
1. package com.javatpoint;
2. import java.io.*;
3. public class BufferedReaderExample {
4. public static void main(String args[])throws Exception{
5. FileReader fr=new FileReader("D:\\testout.txt");
6. BufferedReader br=new BufferedReader(fr);
7.
8. int i;
9. while((i=br.read())!=-1){
10. System.out.print((char)i);
11. }
12. br.close();
13. fr.close();
20
14. }
15. }
Here, we are assuming that we have following data in "testout.txt" file:
Output:
Welcome to javaTpoint.
Closing the BufferedReader
It is important to note that when finished using a BufferedReader, it should be closed to release
any system resources associated with it, such as file handles or network connections. In the
above example, we use a try-with-resources statement to ensure that the BufferedReader is
automatically closed when no longer needed.
Reading data from console by InputStreamReader and BufferedReader
In this example, we are connecting the BufferedReader stream with the InputStreamReader
stream for reading the line by line data from the keyboard.
BufferedReaderExample.java
1. package com.javatpoint;
2. import java.io.*;
3. public class BufferedReaderExample{
4. public static void main(String args[])throws Exception{
5. InputStreamReader r=new InputStreamReader(System.in);
6. BufferedReader br=new BufferedReader(r);
7. System.out.println("Enter your name");
8. String name=br.readLine();
9. System.out.println("Welcome "+name);
10. }
11. }
Output:
Enter your name
Nakul Jain
Welcome Nakul Jain
21
Another example of reading data from console until user writes stop.
In this example, we are reading and printing the data until the user prints stop.
BufferedReaderExample.java
1. package com.javatpoint;
2. import java.io.*;
3. public class BufferedReaderExample{
4. public static void main(String args[])throws Exception{
5. InputStreamReader r=new InputStreamReader(System.in);
6. BufferedReader br=new BufferedReader(r);
7. String name="";
8. while(!name.equals("stop")){
9. System.out.println("Enter data: ");
10. name=br.readLine();
11. System.out.println("data is: "+name);
12. }
13. br.close();
14. r.close();
15. }
16. }
Output:
22
Enter data: Nakul
data is: Nakul
Enter data: 12
data is: 12
Enter data: stop
data is: stop
The BufferedReader class in Java provides a powerful and efficient mechanism for reading
character input from various sources. By buffering input and offering convenient methods for
reading text, it simplifies the process of handling input streams, making it an invaluable tool for
tasks ranging from file processing to network communication. Whether you're parsing large text
files or interacting with external data sources, BufferedReader empowers Java developers with
the tools they need to efficiently handle input streams in their applications.
Java Scanner
Scanner class in Java is found in the java.util package. Java provides various ways to read input
from the keyboard, the java.util.Scanner class is one of them.
The Java Scanner class breaks the input into tokens using a delimiter which is whitespace by
default. It provides many methods to read and parse various primitive values.
The Java Scanner class is widely used to parse text for strings and primitive types using a regular
expression. It is the simplest way to get input in Java. By the help of Scanner in Java, we can get
input from the user in primitive types such as int, long, double, byte, float, short, etc.
The Java Scanner class extends Object class and implements Iterator and Closeable interfaces.
The Java Scanner class provides nextXXX() methods to return the type of value such as
nextInt(), nextByte(), nextShort(), next(), nextLine(), nextDouble(), nextFloat(), nextBoolean(),
etc. To get a single character from the scanner, you can call next().charAt(0) method which
returns a single character.
Java Scanner Class Declaration
1. public final class Scanner
2. extends Object
3. implements Iterator<String>
How to get Java Scanner
To get the instance of Java Scanner which reads input from the user, we need to pass the input
stream (System.in) in the constructor of Scanner class. For Example:
1. Scanner in = new Scanner(System.in);
23
To get the instance of Java Scanner which parses the strings, we need to pass the strings in the
constructor of Scanner class. For Example:
1. Scanner in = new Scanner("Hello Javatpoint");
Java Scanner Class Constructors
SN Constructor Description
1) Scanner(File source) It constructs a new Scanner that produces
values scanned from the specified file.
24
Java Scanner Class Methods
The following are the list of Scanner methods:
25
11) boolean hasNextDouble() It is used to check if the next token in
this scanner's input can be interpreted
as a BigDecimal using the nextByte()
method or not.
12) boolean hasNextFloat() It is used to check if the next token in
this scanner's input can be interpreted
as a Float using the nextFloat() method
or not.
13) boolean hasNextInt() It is used to check if the next token in
this scanner's input can be interpreted
as an int using the nextInt() method or
not.
14) boolean hasNextLine() It is used to check if there is another
line in the input of this scanner or not.
15) boolean hasNextLong() It is used to check if the next token in
this scanner's input can be interpreted
as a Long using the nextLong() method
or not.
16) boolean hasNextShort() It is used to check if the next token in
this scanner's input can be interpreted
as a Short using the nextShort() method
or not.
17) IOException ioException() It is used to get the IOException last
thrown by this Scanner's readable.
18) Locale locale() It is used to get a Locale of the Scanner
class.
19) MatchResult match() It is used to get the match result of the
last scanning operation performed by
this scanner.
20) String next() It is used to get the next complete token
from the scanner which is in use.
21) BigDecimal nextBigDecimal() It scans the next token of the input as a
BigDecimal.
22) BigInteger nextBigInteger() It scans the next token of the input as a
BigInteger.
23) boolean nextBoolean() It scans the next token of the input into
26
a boolean value and returns that value.
24) byte nextByte() It scans the next token of the input as a
byte.
25) double nextDouble() It scans the next token of the input as a
double.
26) float nextFloat() It scans the next token of the input as a
float.
27) int nextInt() It scans the next token of the input as an
Int.
28) String nextLine() It is used to get the input string that was
skipped of the Scanner object.
29) long nextLong() It scans the next token of the input as a
long.
30) short nextShort() It scans the next token of the input as a
short.
31) int radix() It is used to get the default radix of the
Scanner use.
32) void remove() It is used when remove operation is not
supported by this implementation of
Iterator.
33) Scanner reset() It is used to reset the Scanner which is
in use.
34) Scanner skip() It skips input that matches the specified
pattern, ignoring delimiters
35) Stream<String> tokens() It is used to get a stream of delimiter-
separated tokens from the Scanner
object which is in use.
36) String toString() It is used to get the string representation
of Scanner using.
37) Scanner useDelimiter() It is used to set the delimiting pattern of
the Scanner which is in use to the
specified pattern.
38) Scanner useLocale() It is used to sets this scanner's locale
object to the specified locale.
27
39) Scanner useRadix() It is used to set the default radix of the
Scanner which is in use to the specified
radix.
Example 1
Let's see a simple example of Java Scanner where we are getting a single input from the user.
Here, we are asking for a string through in.nextLine() method.
1. import java.util.*;
2. public class ScannerExample {
3. public static void main(String args[]){
4. Scanner in = new Scanner(System.in);
5. System.out.print("Enter your name: ");
6. String name = in.nextLine();
7. System.out.println("Name is: " + name);
8. in.close();
9. }
10. }
Output:
Enter your name: sonoo jaiswal
Name is: sonoo jaiswal
Example 2
1. import java.util.*;
2. public class ScannerClassExample1 {
3. public static void main(String args[]){
4. String s = "Hello, This is JavaTpoint.";
5. //Create scanner Object and pass string in it
6. Scanner scan = new Scanner(s);
7. //Check if the scanner has a token
8. System.out.println("Boolean Result: " + scan.hasNext());
28
9. //Print the string
10. System.out.println("String: " +scan.nextLine());
11. scan.close();
12. System.out.println("--------Enter Your Details-------- ");
13. Scanner in = new Scanner(System.in);
14. System.out.print("Enter your name: ");
15. String name = in.next();
16. System.out.println("Name: " + name);
17. System.out.print("Enter your age: ");
18. int i = in.nextInt();
19. System.out.println("Age: " + i);
20. System.out.print("Enter your salary: ");
21. double d = in.nextDouble();
22. System.out.println("Salary: " + d);
23. in.close();
24. }
25. }
Output:
Boolean Result: true
String: Hello, This is JavaTpoint.
-------Enter Your Details---------
Enter your name: Abhishek
Name: Abhishek
Enter your age: 23
Age: 23
Enter your salary: 25000
Salary: 25000.0
Example 3
29
1. import java.util.*;
2. public class ScannerClassExample2 {
3. public static void main(String args[]){
4. String str = "Hello/This is JavaTpoint/My name is Abhishek.";
5. //Create scanner with the specified String Object
6. Scanner scanner = new Scanner(str);
7. System.out.println("Boolean Result: "+scanner.hasNextBoolean());
8. //Change the delimiter of this scanner
9. scanner.useDelimiter("/");
10. //Printing the tokenized Strings
11. System.out.println("---Tokenizes String---");
12. while(scanner.hasNext()){
13. System.out.println(scanner.next());
14. }
15. //Display the new delimiter
16. System.out.println("Delimiter used: " +scanner.delimiter());
17. scanner.close();
18. }
19. }
Output:
Boolean Result: false
---Tokenizes String---
Hello
This is JavaTpoint
My name is Abhishek.
Delimiter used: /
30