How many classes are there in Java standard edition?

后端 未结 9 2063
逝去的感伤
逝去的感伤 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:05

    I see 3793 counting interfaces and abstract classes, as well as private classes.

    0 讨论(0)
  • 2020-12-13 13:08

    Calculating classes and subclasses is a cumbersome task, but you can know the number of files. 4240 total files in Jdk 8. Click here for the list of all files.

    0 讨论(0)
  • 2020-12-13 13:13

    For Java SE 9 , according to the API doc 6005 including abstract and interfaces.

    For Java SE 10, according to the API doc 6002 including abstract and interfaces.

    https://docs.oracle.com/javase/10/docs/api/allclasses-noframe.html

    Method : view source, and count "<li>" html tag with notepad++.

    For Java SE 11, according to the API doc 4411 including abstract and interfaces.

    For Java SE 12, according to the API doc 4433 including abstract and interfaces.

    https://docs.oracle.com/en/java/javase/12/docs/api/allclasses-index.html

    Method : view source, and count "colFirst" css class with notepad++

    0 讨论(0)
  • 2020-12-13 13:17

    I'm also curious about this topic. I found this: enter image description here

    (source: Java 8 Pocket Guide book by Robert Liguori, Patricia Liguori)

    0 讨论(0)
  • 2020-12-13 13:21

    I see 3762 within Java 8 as following

    All Classes ( Outer as well as Inner ) , Enums and Interfaces -  3762
    All except Inner Classes                                      -  3462
    Only Classes ( Outer + Inner + Abstract + Enum )              -  2963
    Interfaces                                                    -  799
    Enum                                                          -  93  
    

    Moreover , Here is the list of classes / interfaces introduced with each version - http://qr.ae/Q2baW

    0 讨论(0)
  • 2020-12-13 13:22
    • Java 1.0.2 : 250 classes
    • Java 1.1 : 500 classes
    • Java 2 (version 1.2-1.4) : 2300 classes
    • Java 5.0 (version 1.5) : 3500 classes

    Source : Head First 2nd edition, Chapter 1, p. 4

    0 讨论(0)
提交回复
热议问题