Interview Questions and Answers for 'Print' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers for 'Print' - 8 question(s) found - Order By Newest

 Q1. Explain System.out.println ?Core Java
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     Asked in 1 Companies      basic        frequent


 Q2. What is the difference between System.console.write and System.out.println ?
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
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. Print natural numbers sequentially with two threads.Core Java
Ans. http://stackoverflow.com/questions/18799591/print-natural-sequence-with-help-of-2-threads1-is-printing-even-and-2nd-is-pri

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

   Like         Discuss         Correct / Improve     print natural numbers with two threads   multithreading   multi threading   threads   code   coding   makemytrip.com


 Q5. What is the difference between print() and println() in Java ?
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


 Q6. How and when the Buffer is cleared when using Buffered Writer Classes ?Core Java
Ans. Buffer is cleared in 2 circumstances, i.e 1. naturally when the buffer is filled and 2. explicitly when the method flush is called ( for flushing the residual )

Ideally we just need to call flush once at the end of file writing so that the residual content should be dumped to file.

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

   Like         Discuss         Correct / Improve     BufferedWriter  Writer  PrintWriter  File io  flush  file handling


 Q7. Difference between System.out.printf and System.out.println ?Core Java
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


 Q8. Why do you want to leave your current job ?General
Ans. The most effective and acceptable reasons for leaving your current job should be positive e.g. moving forward in your life or career

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

   Like         Discuss         Correct / Improve          Asked in 21 Companies


 Q9. 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


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: