如何通过传递java项目的路径来计算该项目中的类和方法的数量?
我正在开发一个java项目,其中我将传递另一个java项目文件的路径,它将显示该特定项目中类、方法、变量及其类型的总数。我将通过文件处理来传递路径,但是我应该编写什么样的代码来显示类和方法的数量呢
你可以在下面搜索框中键入要查询的问题!
我正在开发一个java项目,其中我将传递另一个java项目文件的路径,它将显示该特定项目中类、方法、变量及其类型的总数。我将通过文件处理来传递路径,但是我应该编写什么样的代码来显示类和方法的数量呢
# 1 楼答案
最好的选择是从支持Java语言的程序中安装并调用一个外部工具。这种工具的一个例子是cloc: