case 1: In this problem when the sequence of line 5 & 6 changed then the output become
we are even
But if we remove ln from println at line 8 thenoutput become
we are even i did
when we remove ln from line 7 & 8 then output become
we are even did
as @Tina Smith said when two writers are associated with a single file,
the second writer to be flushed overwrites the first writer. so in this case the file doom.txt should contain "we are even" i.e true for case 1.
but when we are removing ln from println then both object comes into picture so file contain changed , and the content is not understandable by me . what actually happening with this sort of code can anyone make me understand.