GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.tutorialspoint.com — Java.io.PrintStream.flush() Method
Selected Reading
Java.io.PrintStream.flush() MethodDescriptionThe java.io.PrintStream.flush() method flushes the stream. This is done by writing any buffered output bytes to the underlying output stream and then flushing that stream. DeclarationFollowing is the declaration for java.io.PrintStream.flush() method. public void flush() ParametersNA Return ValueThis method does not return a value. ExceptionNA ExampleThe following example shows the usage of java.io.PrintStream.flush() method. package com.tutorialspoint;
import java.io.*;
public class PrintStreamDemo {
public static void main(String[] args) {
String s = "Hello World.";
// create printstream object
PrintStream ps = new PrintStream(System.out);
// print our string
ps.print(s);
// flush the stream to see the results
ps.flush();
// print new string
ps.println();
ps.print("This is an example");
// flush to see new string
ps.flush();
}
}
Let us compile and run the above program, this will produce the following result − Hello World. This is an example java_io_printstream.htm
Advertisements
|
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |