• Post Reply Bookmark Topic Watch Topic
  • New Topic

Using command line arguments as parameter  RSS feed

 
jasmine tucker
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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***********************************************
 
Carey Brown
Saloon Keeper
Posts: 3323
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your start() and stop() methods are not actually resetting the start/stop times.
What will the command line look like, give an example.
 
jasmine tucker
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
jasmine tucker
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Carey Brown
Saloon Keeper
Posts: 3323
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Well, this will either never run or run in an infinite loop. It doesn't address 'seconds'.
 
jasmine tucker
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!