Java - Interview Questions and Answers for 'Println' | Search Java Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com
Share

Search Java Interview Questions


 2098 questions in repository.
 There are more than 200 unanswered questions.
Click here and help us by providing the answer.
Label / Company      Label / Company / Text

   



Interview Questions and Answers for 'Println' - 6 question(s) found - Order By Newest

 Q1. Explain System.out.println ?Core Java2016-11-25 09:37:08

Ans. System is a class within java.lang package that contains several useful class fields and methods. It cannot be instantiated and hence can use only statically.even in this case this has been used statically i.e with class name itself and without creating an instance.

out is the static reference of Printstream declared as following in the System Class -

public final static PrintStream out = null;

println is the method of PrintStream class.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     System class  Streams  Input Output  println      basic        frequent


 Q2. What is the difference between System.console.write and System.out.println ?
Admin
info@buggybread.com
Ans. System.console() returns null if your application is not run in a terminal (though you can handle this in your application)System.console() provides methods for reading password without echoing charactersSystem.out and System.err use the default platform encoding, while the Console class output methods use the console encoding

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   system class   system.out.println   system.console.write   input output   java6      intermediate        rare


 Q3. What is the difference between out.println(a+b); and out.println (a+" " +b); in Java? with a=2 and b=1Core Java
Admin
info@buggybread.com
Ans. First will give the ouput as 3 and the second will give output as 2 1

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   system.out.println   coding


 Q4. What is the difference between print() and println() in Java ?2016-07-18 11:12:34

Ans. print method prints the argument passed to the method whereas println prints the argument and then prints the new line character. println is generally used if we want each output in a new line.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     print   println


 Q5. Difference between System.out.printf and System.out.println ?Core Java2016-11-25 09:38:09

Ans. println prints an additional end of line whereas printf doesnt.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     System class  Streams  Input Output  println  printf


 Q6. What is out in System.out.println ?Core Java
a. out is static inner class
b. out is the reference for static inner class object
c. out is the static reference to OutputStream object
d. out is the static reference to PrintStream object

Ans.d. out is the static reference to PrintStream object



Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus
 

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked:
         

X Close this

X Close this

Help Us Improve.
Please share your
interview experience.

Company Name:   


Questions Asked: