I put some output statements for tracking some outputs.
Here I have one question: When I give input as 2100 and 0100
I got output of Math.min(2100, 0100) as 64.0?
I don't why? If anybody can then please explain.
How do you enter these time values in your program? The behavior described leads me to believe that they are "hardcoded" in your program. If you have a number in a
Java program that starts with a leading zero, it is interpreted as octal (base 8). 0100 base 8 is the same as 64 base 10. If you are unfamiliar with number systems, you should google for information on how to convert between numbers in different bases.
If you let the user enter these numbers, either as command line arguments or using an InputStream or Reader of some sort, you can avoid these issues.
HTH
Layne