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

Search Java Interview Questions


 2137 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 'Input output' - 12 question(s) found - Order By Newest

 Q1. Name few IO Stream classes and interfaces ?Core Java
Admin
info@buggybread.com
Ans. http://www.buggybread.com/2015/01/java-stream-io-classes-and-interfaces.html

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

   Like      Discuss      Correct / Improve     java   io   input output   stream


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


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


 Q4. Tell something about BufferedWriter ? What are flush() and close() used for ?
Admin
info@buggybread.com
Ans. A Buffer is a temporary storage area for data. The BufferedWriter class is an output stream.It is an abstract class that creates a buffered character-output stream.Flush() is used to clear all the data characters stored in the buffer and clear the buffer.Close() is used to closes the character output stream.

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

   Like      Discuss      Correct / Improve     java   java io   input output   file handling   file io   output stream   bufferedwriter   flush   close


 Q5. Name few Buffered IO classes and interfaces ?
Admin
info@buggybread.com
Ans. http://www.buggybread.com/2015/01/java-io-buffered-classes-and-interfaces.html

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

   Like      Discuss      Correct / Improve     java   io   input output   buffered io   buffered input output


 Q6. Name few Writer classes ?
Admin
info@buggybread.com
Ans. http://www.buggybread.com/2015/01/java-output-writer-classes-and.html

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

   Like      Discuss      Correct / Improve     java   input output   io   writer


 Q7. Name few Reader classes ?
Admin
info@buggybread.com
Ans. http://www.buggybread.com/2015/01/java-input-reader-classes-and-interfaces.html

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

   Like      Discuss      Correct / Improve     java   input output   io   reader


 Q8. Name few File IO related classes and interfaces ?Core Java
Admin
info@buggybread.com
Ans. http://www.buggybread.com/2015/01/java-file-io-classes-and-interfaces.html

  Sample Code for File

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

   Like      Discuss      Correct / Improve     java   io   input output   file io  file handling


 Q9. Difference between Scanner and BufferedReader ? Which one is faster and Why ?Core Java
Admin
info@buggybread.com
Ans. Scanner is used for parsing tokens from the contents of the stream while BufferedReader just reads the stream.

BufferedReader read files efficiently by using a buffer to avoid physical disk operations.

Buffer size of Scanner is usually smaller than the Buffered Writer.

BufferedReader is faster that Scanner as it just reads the Stream and doesn't Parse the tokens to read the stream into primitive data types.

  Sample Code for Scanner

  Sample Code for BufferedReader

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

   Like      Discuss      Correct / Improve     java   file io   input output   scanner   bufferedreader  file handling



Do you think these are the Best Java Frameworks ?

OpenXavaSPRING MVCApache StripesCheck everything
that is Best in Java

Click Here



 Q10. What is System.in in Java ?Core Java2016-09-02 08:24:11

Ans. It is an InputSream which is usually connected to the keyboard input of console program.

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

   Like      Discuss      Correct / Improve     System.in  Input Stream  Input Output


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


 Q12. What is the difference between hasNextInt and nextInt method of scanner class ?Core Java2017-07-23 18:29:51

Ans. The hasNextInt() is used to check if there are any more elements left and the nextInt() is used to access that element.

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

   Like      Discuss      Correct / Improve     input output  Scanner




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: