any other way to print the text without using
System.out.println() in java?

Answer Posted / srinivas

Using PrintWriter class-

PrintWriter writer = new PrintWriter(System.out);
writer.println("Method 2");



PrintWriter makes the output internationalizable - because encodings like UTF-8 can be specified.

Is This Answer Correct ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What defines function?

762


What is data structure in java?

768


What is string in java? String is a data type?

802


What is Session reduplication and how its done?

1802


Explain method overloading?

794


What is a stack class in java ?

881


What is the escape character in java?

765


What is a boolean field?

756


How can you handle java exceptions?

762


What does compareto () do in java?

807


why Interface used?

768


What are the 3 types of loops in java?

764


Can java arraylist hold different types?

758


What is the final keyword denotes?

899


why we use merge option in hybernate pls give a ex snippet

1727