Explanation
This Java program is designed to determine if a smaller sequence of characters, referred to as a "substring," is present within a larger sequence of characters, known as the "main string." It achieves this by first prompting the user to input the main string they wish to search within, followed by the specific substring they are looking for.
Once both strings are provided by the user, the program employs a built-in Java string method to efficiently check for the existence of the substring inside the main string. Based on the outcome of this check, it outputs a clear message indicating whether the substring was found or not. Finally, it ensures that the resources used for input are properly closed to prevent any leaks.