orrect answerWhat is the output of this program? (Assume 'inputoutput.java' file exists in the current directory)import java.io.*;class filesinputoutput { public static void main(String args[]) throws FileNotFoundException, IOException { InputStream obj = new FileInputStream("inputoutput.java"); System.out.print(obj.available()); obj.close(); }}
Question
orrect answerWhat is the output of this program? (Assume 'inputoutput.java' file exists in the current directory)import java.io.*;class filesinputoutput { public static void main(String args[]) throws FileNotFoundException, IOException { InputStream obj = new FileInputStream("inputoutput.java"); System.out.print(obj.available()); obj.close(); }}
Solution
The output of this program will be the number of bytes available to be read from the file 'inputoutput.java'. The 'available()' method of an InputStream object returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next invocation of a method for this input stream. The actual result depends on the file size.
Similar Questions
swerWhat is the output of this program? (Assume 'inputoutput.java' file exists in the current directory)import java.io.*;class filesinputoutput { public static void main(String args[]) throws FileNotFoundException, IOException { InputStream obj = new FileInputStream("inputoutput.java"); System.out.print(obj.available()); obj.close(); }}Optionstrueprints number of bytes in filefalseprints number of characters in the file
e correct answerWhat is the output of the following Java program?class Main { public static void main(String args[]) { final int i; i = 20; i = 30; System.out.println(i); }}
What is the output of following Java program?import static java.lang.System.*;class ProgrammingInJava { public static void main(String args[]) { out.println("Welcome!"); }}OptionsCompiler ErrorWelcome!None of these Runtime Error
What will be the output of the following Java program? package pkg; class output {public static void main(String args[]) { StringBuffer s1 = new StringBuffer("Hello"); s1.setCharAt(1, x); System.out.println(s1); } }
What is the output of the following Java program?
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.