Question: Write a program that converts a Java file into an HTML file. In the HTML file, the keywords, comments, and literals are displayed in bold

Write a program that converts a Java file into an HTML file. In the HTML file, the keywords, comments, and literals are displayed in bold navy, green, and blue, respectively. Use the command line to pass a Java file and an HTML file. For example, the following command java Exercise21_05 Welcome.java Welcome.html converts Welcome.java into Welcome.html. Figure 21.8a shows a Java file. The corresponding HTML file is shown in Figure 21.8b.

Welcome.java - Notepad Eile Edit Format View Help V/ This application displays

Welcome to Java! public class Welcome { public static void main(String[] args)

Welcome.java - Notepad Eile Edit Format View Help V/ This application displays Welcome to Java! public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); (a)

Step by Step Solution

3.31 Rating (169 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Usage Copy this class to the folder run it with java JavaToHTMLftim to generate HTM file for all the java file in this folder The generated htm files ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Introduction to Java Programming and Data Structure Questions!