Home » Development » Java » Code Counter

This Java class will return (Read: print) two variables; lines of code and logical lines of code.

Lines of code include anything that is not whitespace.

Logical lines of code includes only lines that are logical code (Read: not comments).

To run this code:

javac CodeCounter.java
java CodeCounter <FileName>

Example Output:

LoC: 64
LLoC: 58

Respond

You must be logged in to post a comment.