Just tells me the program has exited.
Printable View
Just tells me the program has exited.
These lines are still outside of the loop:I'm done for tonight. Back tomorrow.Code:// readFile r = new readFile();
System.out.println("Please enter:\n 1 to add a business contact\n 2 to add a personal conatact"
+ "\n 3 to display the contacts \n 4 to Quit " );
int enter = in.nextInt();
I hae the loop exited correctlt now by removing 4 form the loop..... Still same issue with showing the contacts.... :(
Could it be possible that I have an issue with my try blocks that read and import my txt files?
I don' think the try blocks would cause the problem that you describe.
Can you post a short sample session with a user? Something like this:
Ask the questions
user enters 1
do work for 1
Ask the questions
user enters 1
do work for 1
Ask the questions
user enters 1
do work for 1
Ask the questions
user enters 2
do work for 2
Ask the questions
user enters 3
do work for 3
Ask the questions
user enters 4
exit loop
Everything else works fine....... I can even open the txt file in notepad and everything is there... but the import and displaying it has the problem.
Is the problem with reading and displaying the contents of a file?Quote:
has the problem.
just displaying the txt file... I write to them correctly..... I can open files with notepad and see everything in there correctly.... But always displays 2 files instead of just one...
Look at previous replies........
Are you saying that there is no problems with reading and displaying the contents of a file?
The problem is with the program's logic: when a read and display request is made, it is done two times.
I asked for a sample user session in post#65. Can you make a list of the events in the order that they should happen when the program is executed? Not what is now happening, but what you want to happen.
Also post the current version of the code and a script for executing it for testing that will show the problem that you are describing.