Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Jose Hughes   on Nov 19 In Java Category.

  
Question Answered By: Beaudi Smith   on Nov 19

After posting that last bit of code i realised it was full of errors!
Maybe it would be easier if u could advice on whats best with the
following:

long depTime = (long) DerbyIO.getInt("Departure Time");
long arrTime = (long) DerbyIO.getInt("Arrival Time");

The programme  uses the above to input the time  as a number  and not as
a real 24 time. I have got what i want to work  but putting  them
together just does not work.

Time t1 = new Time(); // create a Time object
Time t2 = new Time(), t3; // and two more
String s = DerbyIO.getString("Enter the time");
String s2 = DerbyIO.getString("Enter a 2nd time");
try {
t1 = Time.parseTime(s2);
t2 = Time.parseTime(s); // convert this String to a Time
}
catch (NumberFormatException e) {
System.err.print(e);
System.exit(0);
}

Does anyone have any ideas how i can use the 2nd bit of code in place
of the first bit?

Share: 

 
 
Didn't find what you were looking for? Find more on Rail-timetable programme basic class Or get search suggestion and latest updates.


Tagged: