How many classes are there in Java standard edition?

后端 未结 9 2065
逝去的感伤
逝去的感伤 2020-12-13 13:00

I am curious how many classes are there in Java standard library. Perhaps someone knows an approximate number?

9条回答
  •  温柔的废话
    2020-12-13 13:26

    I counted 17,338 in Java 6.0. My methodology:

    jar -tf ${JAVA}/jre/lib/rt.jar > rtjar.txt
    emacs rtjar.txt
    

    I deleted two lines related to the manifest (and thus not representing a class). I believe that the other lines all refer to classes, but I did not do an exhaustive check. Then I went to the bottom of the file and emacs told me that there 17,338 lines.

    This includes stuff like: java/io/ObjectOutputStream$1.class.

提交回复
热议问题