FileInputStream fin=new FileInputStream("tata.doc"); int i; while((i=fin.read())!=-1) { System.out.print((char)i); }
If I run above code for abc.java instead of tata.doc -> then its working fine. Its printing containts of abc.java on the console. But If I run for tata.doc -> then its printing something different on the console. Why this happen?
Not enough information provided for a full answer, but...
What output do you get? What output did you expect?
What is this .doc file? Is it a Microsoft Word document? If so, remember that's not a text file, it's binary (maybe compressed XML?). You can't just print it as raw characters.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.