Sail E0 Webinar
Question


What is the output of this program?


import java.io.*;
class filesinputoutput {
public static void main(String args[]) {
InputStream obj = new FileInputStream("inputoutput.java");
System.out.print(obj.available());
}
}


Note: inputoutput.java is stored in the disk.


Options:
A .  true
B .  false
C .  prints number of bytes in file
D .  prints number of characters in the file
Answer: Option C

obj.available() returns the number of bytes.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers