PrintStream Print1() Example

Prints a boolean value.


PrintStreamclass Print1() method example. This example shows you how to use Print1() method.This method Prints a boolean value.

Here is the code:-

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

public class Print1 {

    public static void main(String[] argsthrows IOException {
        boolean c = false;
        //Creating FileOutputStream object
        FileOutputStream out = new FileOutputStream("/home/girish/Desktop/g/m.txt");
        FileInputStream fin = new FileInputStream("/home/girish/Desktop/g/m.txt");
        //Creating PrintStream object
        PrintStream ps = new PrintStream(out);
        //Prints a boolean value.
        ps.print(c);
        System.out.print((char)fin.read());
        System.out.print((char)fin.read());
        System.out.print((char)fin.read());
        System.out.print((char)fin.read());
        System.out.print((char)fin.read());
       
          }
}

Output of the Program
 false

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

HOME | COPYRIGHT | CONTACT US