Is it better to use try/catch instead of multiple IF statements?
问题 Is it better, less expensive or more readable to use a try/catch block in Java instead of using multiple If statements to check user input for example? Example when parsing a Date string, won't it be better to parse directly using a try/catch block instead of writing multiple statements looking for illegal characters. In another example, say i want to read a file or stream, instead of using Scanner , I just force the method and wait for an exception to occur. Is that a healthy method of