Write a method named findHtmlTags that accepts aScanner. The Scanner parameter r
ID: 3611616 • Letter: W
Question
Write a method named findHtmlTags that accepts aScanner. The Scanner parameter represents an input file. Yourmethod should read the file, assuming that the file contains anHTML web page, and prints all the HTML tags in the file. A tag isany text between <and> characters. For example,If the file contains the followingtext:
<html>
<head>
<title>My web page</title>
</head>
<body>
<p>There are many pictures of my cat here,
as well as my <b>very cool</b> blog page,
which contains <font color="red">awesome</font>
stuff about my trip to Vegas.<p>
Here's my cat now: <img
src="https://s3.amazonaws.com/answer-board-image/cat.jpg">
</body>
</html>
Your program should output the followingtext:
<html>
<head>
<title>
</title>
</head>
<body>
<p>
<b>
</b>
<font color="red">
</font>
<p>
<imgsrc="https://s3.amazonaws.com/answer-board-image/cat.jpg">
</body>
</html>
Assume that the file is a well-formed HTMLdocument. Assume that no tag contains a < or > characterinside itself.
public static void main (String[] args)throws IOException {
Scanner infile = new Scanner(newFile("Sample.html");
findHtmlTags(infile);
infile.close();
}