Featured Article

Chocolate Distribution Problem

Given an array of n integers where each value represents number of chocolates in a packet. Each packet can have variable number of chocolates. There are m students, the task is to distribute chocolate packets such that : Each student gets one packet. The difference between the number of chocolates in packet with maximum chocolates… Read More »

Java.io.CharArrayWriter class in Java | Set 2

CharArrayWriter class in Java | Set 1 Methods: append (char Sw) : java.io.CharArrayWriter.append(char Sw) appends a single character to the Writer. Syntax: public CharArrayWriter append(char Sw) Parameters : Sw : character to be append Return : CharArrayWriter append (CharSequence char_sq) : java.io.CharArrayWriter.append(CharSequence char_sq) appends specified character sequence to the Writer. Syntax: public CharArrayWriter append(CharSequence char_sq)… Read More »

Java.io.CharArrayWriter class in Java | Set 1

java.io.CharArrayWriter class creates a character buffer that can be used as a writer. The buffer automatically grows when data is written to the stream. The data can be retrieved using toCharArray() and toString(). Declaration: public class CharArrayWriter extends Writer Constructor : CharArrayWriter() : Creating a CharArrayWriter from a specified character array. CharArrayWriter(int size) : Creating… Read More »

Java.io.FileInputStream Class in Java

FileInputStream is useful to read data from a file in the form of sequence of bytes. FileInputStream is meant for reading streams of raw bytes such as image data. For reading streams of characters, consider using FileReader. Constructor and Description FileInputStream(File file) :Creates an input file stream to read from the specified File object. FileInputStream(FileDescriptor… Read More »

SQL | GROUP BY

The GROUP BY Statement in SQL is used to arrange identical data into groups with the help of some functions. i.e if a particular column has same values in different rows then it will arrange these rows in a group. Important Points: GROUP BY clause is used with the SELECT statement. In the query, GROUP… Read More »

java.io.CharArrayReader Class in Java

java.io.CharArrayReader class creates a character buffer using a character array. Declaration: public class CharArrayReader extends Reader Constructor : CharArrayReader(char[] char_array) : Creates a CharArrayReader from a specified character array. CharArrayReader(char[] char_array, int offset, int maxlen) : Creates a CharArrayReader from a specified part of character array. Methods: read() : java.io.CharArrayReader.read() reads a single character and… Read More »