文件名称:JavaCodeAnalyzer
- 所属分类:
- JSP源码/Java
- 资源属性:
- [Java] [源码]
- 上传时间:
- 2015-03-04
- 文件大小:
- 46kb
- 下载次数:
- 0次
- 提 供 者:
- 李**
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
Java语言共有50个关键字(自行查找相关文档),已知Java源程序是以“.java”为扩展名的文本文件。可以考虑在Java源程序中共有3类元素:
<1> 代码行,可运行的Java源代码;
<2> 注释行,3种注释均可;
<3> 空行,既无代码,也无注释;
编写一个类名为JavaCodeAnalyzer的类,实现以下功能:
<1> 该类可以以一个Java源程序文件名创建一个对象,如果文件不存在,或扩展名不是“.java”,应提示文件错误;
<2> 对该源程序文件进行分析其中的:代码行数、注释行数和空行数。说明:行是指以回车结束的。
<3> 统计并按从多到少输出出现次数最多的5个关键字及其出现次数。
<4> 统计分析的结果输出到名为:result.txt的文本文件中,输出格式如下:
分析XXXXX.java源程序的结果:
代码行数:xxx,占xx.xx
注释行数:xxx,占xx.xx
空白行数:xxx,占xx.xx
源程序总行数:xxxx
出现最多的5个关键字是:
关键字1:xx次
关键字2:xx次
关键字3:xx次
关键字4:xx次
关键字5:xx次
分析时间:年-月-日,时-分-秒-A total of 50 Java language keyword (self locate relevant documents), known Java source code is .java extension of the text file. There are three types of elements can be considered in the Java source code:
<1> line of code, you can run the Java source code
<2> comment line, three kinds of comments can be
<3> a blank line, neither the code nor comment
Write a class named class JavaCodeAnalyzer achieve the following functions:
<1> class can create an object with a Java source file name, if the file does not exist, or the extension is not a .java , should prompt file error
<2> where the source files are analyzed: the number of lines of code, comments, number of rows and empty rows. Descr iption: A row is ending with a carriage return.
<3> Statistical press more to less output occurs most frequently five keywords and number of occurrences.
<4> The results of statistical analysis of the output to a file named: result.txt text file, t
<1> 代码行,可运行的Java源代码;
<2> 注释行,3种注释均可;
<3> 空行,既无代码,也无注释;
编写一个类名为JavaCodeAnalyzer的类,实现以下功能:
<1> 该类可以以一个Java源程序文件名创建一个对象,如果文件不存在,或扩展名不是“.java”,应提示文件错误;
<2> 对该源程序文件进行分析其中的:代码行数、注释行数和空行数。说明:行是指以回车结束的。
<3> 统计并按从多到少输出出现次数最多的5个关键字及其出现次数。
<4> 统计分析的结果输出到名为:result.txt的文本文件中,输出格式如下:
分析XXXXX.java源程序的结果:
代码行数:xxx,占xx.xx
注释行数:xxx,占xx.xx
空白行数:xxx,占xx.xx
源程序总行数:xxxx
出现最多的5个关键字是:
关键字1:xx次
关键字2:xx次
关键字3:xx次
关键字4:xx次
关键字5:xx次
分析时间:年-月-日,时-分-秒-A total of 50 Java language keyword (self locate relevant documents), known Java source code is .java extension of the text file. There are three types of elements can be considered in the Java source code:
<1> line of code, you can run the Java source code
<2> comment line, three kinds of comments can be
<3> a blank line, neither the code nor comment
Write a class named class JavaCodeAnalyzer achieve the following functions:
<1> class can create an object with a Java source file name, if the file does not exist, or the extension is not a .java , should prompt file error
<2> where the source files are analyzed: the number of lines of code, comments, number of rows and empty rows. Descr iption: A row is ending with a carriage return.
<3> Statistical press more to less output occurs most frequently five keywords and number of occurrences.
<4> The results of statistical analysis of the output to a file named: result.txt text file, t
(系统自动生成,下载前可以参看下载内容)
下载文件列表
JavaCodeAnalyzer
................\build
................\build.xml
................\.....\built-jar.properties
................\.....\classes
................\.....\.......\file
................\.....\.......\....\JavaCodeAnalyzer$1.class
................\.....\.......\....\JavaCodeAnalyzer.class
................\.....\.......\....\JavaCodeAnalyzer.java
................\.....\empty
................\.....\generated-sources
................\.....\.................\ap-source-output
................\dist
................\....\README.TXT
................\manifest.mf
................\nbproject
................\.........\build-impl.xml
................\.........\genfiles.properties
................\.........\private
................\.........\.......\config.properties
................\.........\.......\private.properties
................\.........\.......\private.xml
................\.........\project.properties
................\.........\project.xml
................\src
................\...\file
................\...\....\JavaCodeAnalyzer.java
................\String.java