/*PROG 13.14 WRITING TO CONSOLE USING PRINTWRITER */
import java.io.*;
class JPS14{
public static void main(String args[])throws IOException
{
PrintWriter phi = new PrintWriter(System.out, true);
int x = 23;
char ch = 'A';
fl oat f = 45.678f;
double d = 2345.45678;
String str = "using PrintWriter";
boolean b = true;
phi.println("\nInteger value x:= " +x);
phi.println("Char value ch:= " +ch);
phi.println("Float value f:= " +f);
phi.println("Double value d:= " +d);
phi.println("String str:= " +str);
phi.println("boolean b:= " +b);
}}
OUTPUT:
Integer value x:= 23
Char value ch:= A
Float value ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.