Issue
To work with java
it's comfortable to get under the hand standard library classes sources, usually available under f4 key in some IDE.
Can someone help to find them? They should be somewhere href="http://hg.openjdk.java.net/jdk/jdk11/file/1ddf9a99e4ad" rel="nofollow noreferrer">here.
Solution
Start Searching inside the src.
When you install Java, there will be a .zip file that contains the source of the standard library called, src.zip in the root folder. These are the standard libraries.
As the name suggests, that zip contains the sources of part of the standard library, but this is NOT the bytecode that you can import and use.
On unzipping src.zip you will find the source code of all the standard library classes. Also, the Java Language Specification should help you.
Below are the few lists of things to know:
- java.util contains all the data structures, The collections framework, legacy collection classes, event model, date and time facilities, internationalization, and miscellaneous utility classes (a string tokenizer, a random-number generator, and a bit array).
- java.net for sockets, connections, etc
- java.io for file reading. Look into java.util.Scanner for simple file reading, but for any more complicated, low-level file reading info, use java.io, it's built for efficiency, while Scanner is for simplicity.
- java.lang is for all the basic classes that are actually imported automatically (implicitly) because it is all the basic ones (String, Integer, Double, etc)
- java.math Java Math class provides several methods to work on math calculations like min(), max(), avg(), sin(), cos(), tan(), round(), ceil(), floor(), abs() etc.
- javax.swing for GUI, which is an extension of the older java.awt
- java.awt Contains all of the classes for creating user interfaces and for painting graphics and images.
I hope this helps.
Answered By - Swapnil Pasarkar
Answer Checked By - Dawn Plyler (JavaFixing Volunteer)