Join 150,195 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,998 people online right now. Registration is fast and FREE... Join Now!
It's was starting to get confusing in the other post. Here's what I have at the moment. I'm basically working on VehicleTest at this time..I know I need more in Vehicle for computing tank milage between the vehicles, but I would like to get VehicleTest working using JOptionPane.
this.computeTankMillage() and other.computeTankMillage()
bbq I guess you looked too fast at that one
nothing wrong with LadyWolf's code. Nothing wrong using "this". This is what the compareTo() method does in all classes that implement the Comparable interface.
That might not work btw, but you definately need to parse 2 vehicles in order to compare them
I'm working on parsing them together in the VehicleTest class. That would be where it needs to be done, right?
Oh my that is a complete lapse of concentration on my behalf. Disregard my above post completely lol, sorry LadyWolf and thanks to pbl for checking over it
Oh my that is a complete lapse of concentration on my behalf. Disregard my above post completely lol, sorry LadyWolf and thanks to pbl for checking over it
It was by accident... I was expecting something else on that post (the complete code for the Test class) I usually don't bother checking posts already answered by bbq
Sorry pbl I was still working Vehicle, and only posted what I had at that time in VehicleTest. Here's what I have at the moment, but I'm still not sure if I did this right using JOptionPane....This does run though Also, I was wondering if I could use JOptionPane instead of println for the output part of VehicleTest? I've been trying to work it to do this, but with no success, it's probably something I'm not doing right.
I was wondering if there was a way use JOptionPane instead of println for the output? I've been trying to work it to do this, but with no success, it's probably something I'm not doing right. Also I noticed that when running it that the output doesn't have a space in between the 2 vehicles information that are being compared. I've tried inserting \n in different parts of the code, but it's not working the way I want it to..
I was wondering if there was a way use JOptionPane instead of println for the output? I've been trying to work it to do this, but with no success, it's probably something I'm not doing right. Also I noticed that when running it that the output doesn't have a space in between the 2 vehicles information that are being compared. I've tried inserting \n in different parts of the code, but it's not working the way I want it to..
I figured out how to get the spaces where I need them