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.append() Method
Selected Reading
Java.io.PrintStream.append() MethodDescriptionThe java.io.PrintStream.append() method appends a subsequence of the specified character sequence to this output stream. DeclarationFollowing is the declaration for java.io.PrintStream.append() method. public PrintStream append(CharSequence csq,int start,int end) Parameters
Return ValueThis method returns this output stream. ExceptionIndexOutOfBoundsException − If start or end are negative, start is greater than end, or end is greater than csq.length(). ExampleThe following example shows the usage of java.io.PrintStream.append() method. package com.tutorialspoint;
import java.io.*;
public class PrintStreamDemo {
public static void main(String[] args) {
CharSequence csq = "Hello World";
// create printstream object
PrintStream ps = new PrintStream(System.out);
// append our character sequences
ps.append(csq, 6, 11);
ps.append(csq, 0, 5);
// print the result
ps.flush();
ps.close();
}
}
Let us compile and run the above program, this will produce the following result − WorldHello 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. |