I suggest you edit your original post and add some "code" tags. Put [code] at the start of the code and [/code] at the end so that the code is properly formatted by the forum software. It is also very important that you add indentation to your code so that it becomes readable.

Most people here will expect a proper problem description. That there is an exception in your program (or rather when you run the program) is more of a fact than a description. What we want to know are things like: what is the full stack trace associated with the exception? under what conditions does it occur?

From a glimpse at the code, one aspect of the conditions giving rise to the exception is the contents of the data file. Consider replacing it with some data included as part of the class or its main() method.

---

Sorry I can't offer any substantial suggestions about the code, but I hope what I have said is helpful. Given a description of what the problem is there are plenty of people here who will be able to help you find what lies behind the runtime exception, and suggest how you might start to correct your code.

October 15th, 2012, 05:42 AM

ind

Re: there is an exception in my program plz correct it.

Hi Nikita,
Please post input.txt file also , because when I tried to execute the program that you have posted,
it gave me FileNotFoundException