Java Programing laungage

Java Input Output Projects

Java I/O Project 1

Java Input Output Examples

Java Input Output Examples

IO Subjective Questions And Answers
More interview questions and answers

Explain how to read a line of input at a time.

When do we need to flush an output stream?

Explain the difference between runnable and extends in java?

Explain the term thread safety and synchronization?

How can I append an existing file in Java?

How can I read from, and write to, files in Java?

How do I connect a Reader to an InputStream?

Why can\'t my applet read or write to files?

When should I use an InputStream, and when should I use a Reader?

Why do threads block on I/O?

When invoking format, what is the best way to indicate a new line?

What class would you use to read a few pieces of data that are at known positions near the end of a large file?

How would you determine the MIME type of a file?

What class in the package gives you access to the entries in a ZIP archive and allows you to read those entries through a stream?

How would you append data to the end of a file? Show the constructor for the class you would use and explain your answer?

How can you improve the performance of the following code? Explain your answer and show the new line(s) of code?

Is the following code legal? try { } finally { }

What is wrong with using this type of exception handler?

Is there anything wrong with this exception handler as written? Will this code compile? try { } catch (Exception e) { } catch (ArithmeticException a) { }

What will happen when you attempt to compile and run this code? import*; class Base{ public static void amethod()throws FileNotFoundException{} } public class ExcepDemo extends Base{ public static void main(String argv[]){ ExcepDemo e = new ExcepDemo(); } public static void amethod(int i)throws IOException{} private boolean ExcepDemo(){ try{ DataInputStream din = new DataInputStream(; System.out.println(Pausing); din.readChar(); System.out.println(Continuing); this.amethod(); return true; }catch(IOException ioe) {} finally{ System.out.println(finally); } return false; } } 1) Compilation and run with no output. 2) Compilation and run with output of Pausing, Continuing and finally 3) Runtime error caused by amethod declaring Exception not in base version 4) Compile and run with output of Pausing and Continuing after a key is hit

Is there a way to make static method not available according to some runtime condition?

What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?