PrintStream Println4() Example

Prints a double and then terminate the line.


PrintStreamclass Println4() method example. This example shows you how to use Println4() method.This method Prints a double and then terminate the line.

Here is the code:-

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

public class Println4 {

    public static void main(String[] argsthrows IOException {
        double d = 23.4;
        //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 double and then terminate the line.
        ps.println(d);
        System.out.print("Double is : ");
        System.out.print((charfin.read());
        System.out.print((charfin.read());
        System.out.print((charfin.read());
        System.out.print((charfin.read());
    }
}

Output of the Program
 Double is : 23.4

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

HOME | COPYRIGHT | CONTACT US