Simple example to use string in different ways. Syntax : String variable_name = "Hello World!" Example : import java.io.*; public class CopyFile { public static void main(String args[]) throws IOException { FileInputStream in = null; FileOutputStream out = null; try { in = new FileInputStream("input.txt"); out = new FileOutputStream("output.txt"); int c; while ((c = in.read()) != -1) { out.write(c); } }finally { if (in != null) { in.close(); } if (out != null) { out.close(); } } } } Description : Step 1: Starting of class Step 2: Start of main function. Step 3: The input or output type of exceptions that occur in main function are thrown away. Step 4 : There are many classes for byte stream but FileInputStream and FileOutputStream are mo
LEARN | EXPLORE | INNOVATE