However, in reality this code is not resilient as it assumes that the input data is good and will split into 3 sub-strings. It will fail if the user does not input good data (on purpose?) - for example if the user inputs 1.28.45 instead of 1:28:45. Or if the user inputs ABCdEF ?
What you need is to validate the input before you use it. Fortunately the String class contains a method called "matches" which allows you to compare the String to what's known as a "regular expression" - which you can think of as a "pattern" to describe the input. So the code should be amended to check that the input matches a pattern of start - one or more digits - colon - one or more digits - colon - one or more digits - end. Anything which does not match this pattern should be considered invalid.
OK, after this point you know your input is all digits with colons separating the hour, minute and second fields. What you don't yet know is that the numbers themselves are valid ... e.g 1:90:45 - should not be valid because there are not 90 minutes in an hour (should be 2:30:45). So subsequent code should really check the validity of each field and return error if it is not valid.
Welcome to the world of real programming - where a significant portion of your time is spent guarding against poor quality input data!