Write a java class called Products that reads product information and extracts products information and print it to the user.
The product code consists of the country initials, the product code followed by the product serial number, product code example: UK-001-176
Your class should contain One Method plus the main method.ExtractInfo that receives a product code as a String.
The method should extract the origin country of the product, its code and then the product serial number and prints out the result and then saves the same result into a file called “Info.txt” as shown below
ExtractInfo(“UK-001-176”) prints and saves the result as
Country: UK, Code:001, Serial: 176
In the main method:
- Ask the user to enter a product code.
- Then,call ExtractInfo method to extract, print,and save the product information.