你的javadoc是否被编译到你的类文件中? [英] Do your javadocs get compiled into your class files?

查看:148
本文介绍了你的javadoc是否被编译到你的类文件中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您编译 java 文件时,是否也将您的javadoc和注释嵌入类文件?



例如,如果你有大的javadoc,它是否影响类文件的整体大小?还是编译器忽略以 // / *

开头的所有内容

javac -g:source )。这意味着将添加源的每一个位。注释,代码,空格,一切。



如果你这样做,那么源的大小很重要。



从运行时的角度来看,差别并不重要。


When you compile your java files, does it also embed your javadocs and comments into the class file?

For example, if you have large javadocs, does it effect the overall size of your class file? Or does the compiler ignore everything beginning with // and /* ?

解决方案

You can tell the compiler to include the sources in the class file (javac -g:source). That means every bit of the source will be added. Comments, code, whitespace, everything.

If you do that, then the size of the source matters. Otherwise, it doesn't.

From a runtime perspective, the difference doesn't matter much.

这篇关于你的javadoc是否被编译到你的类文件中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆