Rewrite Listing 21.7 CountKeywords. java to read in a Java source code file and count the occurrence

Question:

Rewrite Listing 21.7 CountKeywords. java to read in a Java source code file and count the occurrence of each keyword in the file, but don?t count the keyword if it is in a comment or in a string literal.

Listing

image

image

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: