So, I have an if statement inside of a for loop. The idea is, if the time difference between the current time and an updated time is greater than 24 hours (86400000 milliseconds), then I print out the claim number.
This what my if statement looks like:
if(difference>86400000){
System.out.println(singleClaim.getString("claimNumber"));
}
and this is what my output looks like (a list of claim numbers with a certain status that have a time difference of over 24 hours):
032394115-01
032398720-01
032395941-01
032398165-01
032395262-01
032395350-01
032392831-01
Now, if there aren't any claim numbers with a certain status that have a time difference of over 24 hours, I want my output to look like this:
No claim numbers meet this criteria.
How would I add that in there?
I tried doing this:
if(difference>86400000){
System.out.println(singleClaim.getString("claimNumber"));
}
else{
System.out.println("No claim numbers meet this criteria.");
}
and changed the data to make sure no claim numbers had a difference greater than 24 hours but this is what I got as my output (the message displayed over and over again instead of the claim numbers):
No claim numbers meet this criteria.
No claim numbers meet this criteria.
No claim numbers meet this criteria.
No claim numbers meet this criteria.
No claim numbers meet this criteria.
No claim numbers meet this criteria.
Aucun commentaire:
Enregistrer un commentaire