PrintStream Print9() Example

Prints a string.


PrintStreamclass Print9() method example. This example shows you how to use Print9() method.This method Prints a string.

Here is the code:-


/**
 * @Program that Prints a string.
 * Print9.java 
 * Author:-RoseIndia Team
 * Date:-10-Jun-2008
 */
import java.io.*;

public class Print9 {

    public static void main(String[] argsthrows IOException {
        String d = "Girish";
        //Creating FileOutputStream object
        FileOutputStream out = new FileOutputStream("text.txt");
        FileInputStream fin = new FileInputStream("text.txt");
        //Creating PrintStream object
        PrintStream ps = new PrintStream(out);
        //Prints a long integer.
        ps.print(d);
        System.out.print("String is : ");
        for(int i=0;i<d.length();i++)
        System.out.print((charfin.read());
                   }
}

Output of the Program
 String is : Girish

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US