Forums Register Login
Using command line arguments as parameter
Okay, so hopefully I have at least gotten a good start. What I'm supposed to do is use the time class and take the command line arguments and print them as the start and end times and then calculate the elapsed time between the two. My issue (hopefully my only as I have been working on this all day now) is that I cannot call the command line arguments using LocalTime. Anyone have any suggestions? Below is what I have so far. Someone please help me with this I REALLY would like to get this done.

*********************************THIS IS THE CLASS I CREATED*******************************************

*******************************THIS IS MY MAIN METHOD***********************************************
Your start() and stop() methods are not actually resetting the start/stop times.
What will the command line look like, give an example.
Okay, and I am completely new to Java but for the command line arguments, I was going to enter three digits. 10 15 20 (hour minute second) I'm working in NetBeans.
Welcome to the Ranch

Stop using NetBeans; that is not suitable for beginners.
You can read about compiling programs in our FAQ and about the command line here. If those links don't answer your questions please ask again.
Lol oh trust me I would if it weren't a requirement. We have to use it for class. I don't know why this assignment is just like over my head because I've had no problems with any of the others. I'll take a look at your suggestions though. Do you have any other suggestions that would help?

Well, this will either never run or run in an infinite loop. It doesn't address 'seconds'.
That I did just to make sure I could read the arguments, it's not staying in the code. I have to use the time class in order to create my code.
What could go wrong in a swell place like "The Evil Eye"? Or with this tiny ad?

This thread has been viewed 589 times.

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2018 14:39:49.