any other way to print the text without using
System.out.println() in java?
Answers were Sorted based on User's Feedback
Answer / sathish
System.out.write("text".getBytes());
System.out.format("%s", "text");
| Is This Answer Correct ? | 20 Yes | 1 No |
Answer / chitu
system.err prints the error, return statements with overrididing the toString method can print the statments
void toString()
{
return cn print this ;
}
| Is This Answer Correct ? | 9 Yes | 10 No |
Answer / 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 |
Answer / hemanth
Yes of course. U can print text without using s.o.p by using static initialization block in Java
| Is This Answer Correct ? | 5 Yes | 12 No |
What best practices should you follow while writing multithreaded code in java?
how you will prevent method overriding?
What is the difference between hashset and treeset in java?
How do you sort in ascending order in java?
What are the standards to place package statement within a source code file?
how we can create packages in java?
Why we use methods in java?
Is void a keyword in java?
What are the steps that are followed when two computers connect through tcp?
Explain method overloading?
How many bits are in a sentence?
as we know a static method could access static data and static method only. then how could main method call the object of aclass which is not static and other non static data