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.

Results 1 to 8 of 8

Thread: Removing A Vehicle

  1. #1
    Junior Member
    Join Date
    Jul 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Removing A Vehicle

    Go--Yourself jps, thanks Greg!


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    4,376
    My Mood
    Mellow
    Thanks
    143
    Thanked 599 Times in 586 Posts

    Default Re: Removing A Vehicle

    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.

  3. #3
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 262 Times in 231 Posts

    Default Re: Removing A Vehicle

    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".

  4. #4
    Junior Member
    Join Date
    Jul 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Removing A Vehicle

    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?

  5. #5
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    4,376
    My Mood
    Mellow
    Thanks
    143
    Thanked 599 Times in 586 Posts

    Default Re: Removing A Vehicle

    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.

  6. #6
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 262 Times in 231 Posts

    Default Re: Removing A Vehicle

    Quote Originally Posted by OllieDee View Post
    what is the facility for attachments for?
    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

  7. #7
    Junior Member
    Join Date
    Jul 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Removing A Vehicle

    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);

  8. #8
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 262 Times in 231 Posts

    Default Re: Removing A Vehicle

    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.

Similar Threads

  1. Best way of adding and removing?
    By J-moges in forum Java Theory & Questions
    Replies: 3
    Last Post: May 23rd, 2013, 01:43 PM
  2. Help with removing objects
    By Seacats in forum Object Oriented Programming
    Replies: 4
    Last Post: May 2nd, 2013, 08:32 AM
  3. removing all buttons from buttongroup
    By yougarage in forum AWT / Java Swing
    Replies: 2
    Last Post: September 13th, 2012, 03:29 AM
  4. The car/vehicle application will be responsible for providing a car simulation.
    By vikasreddy556 in forum What's Wrong With My Code?
    Replies: 13
    Last Post: June 20th, 2011, 01:32 AM