JAVA Library - JDK

 JAVA Library

              Java is providing all the features which makes developers life easy through JAVA API. In Java API all the classes of similar functionalities will group under one package like that JAVA contains many packages in the JAVA API like java.lang, java, util, java.io etc…… To use any of the JAVA predefined feature in JAVA API we should know where the package the class belongs to. After knowing that we have to use full name to import any class in JAVA API like below.


                   import java.util.ArrayList;


            Here java.util.ArrayList is the full name of the class ., Java made this particular to remove confusion of the same class names . Thats why we have to import with complete name.


           We will get one doubt that we are using many java builtin classes like System, String etc… but we are not writing and import statement for these classes how JAVA will manage ?  


          All the basic stuff like string., System etc.. are grouped under one package called java.lang and this is the default package of the JAVA and to remove boilerplates of writing import statements for these basic things JAVA make java.lang as default package that’s why every class will understand all the classes from java.lang without import statement.


       Complete collection framework which is introduced in JAVA 5 which is under java.util package.


    So., How to remember all the classes of API and which package they belongs to. This we will get from exploring many books related to JAVA API and we can go through the official documentation of JAVA from Oracle to know all the packages and classes . After Java 8 release oracle made complete java into modules all the core java related they put into java.base . Like that they maintained many modules. java.basic will cover complete core java.



             The website link for documentation of java Api’s is below :


      https://docs.oracle.com/en/java/javase/22/docs/api/index.html 


            You can replace the version No with what you want

Comments

Popular posts from this blog

JAVA Collections

JAVA Annotations