พิมพ์ของจาวา
//print and create new line after
System.out.println("text");
System.out.println(String);
//You can use any variable type, not just strings, although
//they are the most common
//Print without creating a new line
System.out.print("text");
System.out.print(String);
ระบบออกไปprintln
public static void main(String[] args){
System.out.println("Hello World");
}
วิธีที่จะพิมพ์อยู่ของจาวา
System.out.println("Hello World!");
จากระบบออกไปprintln
System.out.print(<string>); //prints in the same line as the previous print
System.out.println(<string>); //prints in a new line
// Example
System.out.print("This ");
System.out.print("will ");
System.out.print("be ");
System.out.print("all ");
System.out.print("in ");
System.out.print("one ");
System.out.print("line.");
System.out.println("Hello World!");
System.out.println("second line");
ระบบออกไปเขียนในพื้นที่วาดภาพตัวอย่างเช่น
public class JavaPrintStreamWriteExample4 {
public static void main(String[] args) {
//out is the object class PrintStream.
byte[] b= {115,104,117,98,104,97,109,95,106,97,100,111,110};
System.out.write(b, 0, 13);
System.out.println();
System.out.print("Successfully printed byte array to this stream.");
}