StringBuffer Java – StringBuffer class and methods with examples

StringBuffer class in Java The StringBuffer in Java is a class that we can use to manipulate Strings. Strings are immutable which means it is of fixed length whereas StringBuffer is mutable and growable meaning we can change the length of string and do different manipulations like append, delete, insert, …

Read moreStringBuffer Java – StringBuffer class and methods with examples

Java Stack Example

What is a Java Stack class? A Java stack class implementation is based on the stack data structure. It follows the concept of the Last-In-First-Out(LIFO) concept which means the element that we insert last will be removed first. In other words, we can delete elements only from the top of …

Read moreJava Stack Example

FileReader Java – How to use FileReader in Java and what to import for FileReader class and methods with Java FileReader Examples

FileReader in Java FileReader in Java is a class that we use to read data from a file. It is character-oriented and returns data in the form of bytes. This class is part of the java.io package and extends the InputStreamReader class. Java FileReader constructors The FileReader class supports two …

Read moreFileReader Java – How to use FileReader in Java and what to import for FileReader class and methods with Java FileReader Examples

DataOutputStream in Java

What is Java DataOutputStream The DataOutputStream class in Java allows us to write primitive data type values to an output stream. This operation is machine-independent and portable. We can use any output stream class like FileOutputStream which is an argument to the DataOutputStream constructor. DataOutputStream dos = new DataOutputStream(OutputStream out); …

Read moreDataOutputStream in Java