PrintStream Println6() Example

Prints an integer and then terminate the line.


PrintStreamclass Println6() method example. This example shows you how to use Println6() method.This method Prints an integer and then terminate the line.

Here is the code:-

/**
 * @Program that Prints an integer and then terminate the line.
 * Println6.java 
 * Author:-RoseIndia Team
 * Date:-10-Jun-2008
 */
import java.io.*;

public class Println6 {

    public static void main(String[] argsthrows IOException {
        int d = 234;
        //Creating FileOutputStream object
        FileOutputStream out = new FileOutputStream("text.txt");
        FileInputStream fin = new FileInputStream("text.txt");
        //Creating PrintStream object
        PrintStream ps = new PrintStream(out);
        //Prints an integer and then terminate the line.
        ps.println(d);
        System.out.print("Integer is : ");
        System.out.print((charfin.read());
        System.out.print((charfin.read());
        System.out.print((charfin.read());
        
    }
}

Output of the Program
 Integer is : 234

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

HOME | COPYRIGHT | CONTACT US