Question: Consider the below java code: import java . 1 0 . * , public olase Main 1 public static void main ( String [ ]
Consider the below java code:
import java
public olase Main
public static void main String args
int values
try RandomAccesaFile file new RandomAccessFile integereTextdat", rw
int
for int ; values. length
file.writeInt values i
file.seek ;
file, readint ;
System.out.printin k
file, seek ;
file, readint
Syatem.out.printin
for int ; i values.lengthr cdots
file, seek i ;
file,readint
System.out.printf ld k
Syatem.out.printin
I catch IOException e
System,out.printin An Io Exception is caught!"
finally
Syatem, out.printin File access done successfully,
When the above code is executed, what output is generated?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
