what value will be return by the read() method once it
reaches the end-of-file?
a. Throws EOException
b. Return null
c. Return -1
d. Read method return nothing, because it is void method



what value will be return by the read() method once it reaches the end-of-file? a. Throws EOExcep..

Answer / ash

Generally the read method reads integer and returns integer...so i think it will return -1.

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More Core Java Interview Questions

Can a lock be acquired on a class in java programming?

1 Answers  


what is difference between class and object?

43 Answers   College School Exams Tests, HCL,


When should a function throw an exception?

1 Answers   Thomson Reuters, Virtusa,


What is the difference between Stream Reader and Stream Writer?

4 Answers  


Package1 and Package2 both have a method name lets say "methodA" with different implementation. When I import both the packages in a java class how can I use both the methods?

7 Answers   Ericsson,


What does \ mean in regex?

1 Answers  


What is java volatile?

1 Answers  


What is null data type?

1 Answers  


What are the classes of java?

1 Answers  


What are the ways in which a thread can enter the waiting state?

1 Answers  


What is type conversion in java?

1 Answers  


What is the difference between static binding and dynamic binding?

1 Answers  


Categories