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

Answers were Sorted based on User's Feedback



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

Answer / sathish

System.out.write("text".getBytes());

System.out.format("%s", "text");

Is This Answer Correct ?    20 Yes 1 No

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

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

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

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

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

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

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

Answer / ravi ranjan

int a=10;

System.out.printf("%d",+a);

Is This Answer Correct ?    2 Yes 9 No

Post New Answer

More Core Java Interview Questions

What do you mean by scope of variable?

0 Answers  


different types of threads?

18 Answers   TCS,


What an i/o filter?

0 Answers  


What is the size of boolean variable?

0 Answers  


Explain Stream Tokenizer?

4 Answers  






What are green threads in java?

0 Answers  


What are the disadvantages of object oriented programming?

0 Answers  


How do you stop a thread in java?

0 Answers  


What is byte code and why is it important to java’s use for internet programming?

0 Answers  


all are saying java doesn't support multiple inheritance but by default Object class is super class for all the user defined classes and we can extend atmost one class so each class can extend more than one class so java supports multiple inheritance?i am confused with this,pls any one explain me.

4 Answers  


Can a class inherit the constructors of its superclass?

9 Answers   iFlex, Wipro,


Name component subclasses that support painting in java programming?

0 Answers  


Categories