Go--Yourself jps, thanks Greg!
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Go--Yourself jps, thanks Greg!
We could help with some code to work with. Show the Vehicle class and any other code you've written to add, remove, and display Vehicle instances.
Welcome to the forum.
Please post the problematic code on the forum and not as an attachment.
Be more specific about what you mean "how I can remove a vehicle from my program" because my answer to that question is "delete it".
I had it attached as a zip, because I was having trouble displaying it, but its up now.
--- Update ---
I put it up as a zip if anyone wanted to run it for themselves, and I was having trouble displaying it, as I'm new here what is the facility for attachments for?
What ways have you tried to remove a vehicle? If it's in the code you've posted, please point to it. If not, please show what you've tried. I don't see a menu option for removing a vehicle so am confused about what you're asking for help with. Provide similar details for your second question about showing the vehicle's details. Giving a sample of the actual and desired outputs is always helpful.
Do not get in the habit of creating String objects using new as you do here:
String opt1 = new String("1. Add a Vechicle :");
There's no reason to do that and one or two reasons why it's not a good idea.
For attaching things that need to be attached. When you have a question, the best way to get an answer is to put it on the forum where more people see it. Few people (if any) will download things to look over. It really does add up in the amount of time it takes to answer questions on forums.
"show me how I can implement some code to remove a vehicle from my program" is still not a very clear question. Figure out when and under what circumstances the vehicle (which vehicle) will need to be removed. Where will it be removed from? How should it be removed?
Best suggestion I have is (like was said) start out with an idea of when and where in the code it should happen. Create a method to do the job, and call the method in the place(s) you want to remove a vehicle.
Use a println in the method to make sure the method is being called when you want it to. Then work on the code that will "remove" the vehicle. ...what ever "remove" means here
Don't condescend me you ---, all I asked for was some help with my program, attached or not, Some people like to check out programs to see if anything in them helps with their question..so I would appreciate an Apology. As for my program I figured it out for myself and your comments didn't really help. I guess that's why all the big company's come to Ireland, because in the long run we are just better programmers. Should not be a Mod = new (mod);
Was it something I said?
...Still, refrain from such language or the moderation staff may be inclined to take further action. Consider this a final warning.