What Is a Header in Java?
- Automatically loaded into every Java program at compile time, this package contains the most basic classes used in programming. This is where you will find the math class, which contains exponential, logarithmic, trigonometric and square root functions. The java.lang package also contains classes that define data types used in computer programs such boolean, integer, float, and character. There is also the system class that provides basic input and output services for Java programs.
- Java programmers creating applications with graphical user interfaces must familiarize themselves with the sprawling set of packages that fall under the java.swing rubric, of which there are 18. The core java.swing package contains all the basic elements of a GUI, such as icons, menus, menu bars, buttons, scroll bars, boxes and borders. In keeping with the "write once, run anywhere" ethic of Java, these GUI elements maintain a high degree of uniformity across platforms.
- This package contains many useful classes that provide basic functionality for Java programs. The random class generates pseudorandom numbers. Based on the international scientific standard of coordinated universal time (UTC), the time class provides highly accurate time facilities, such as time and date stamps. The java.util package provides two calendar classes, calendar and gregoriancalendar. The latter class reflects the standard calendar adopted in 1582 and used by much of the world. The calendar class defaults to the Gregorian Calendar, but also leaves room for the enterprising programmer to create sub-classes based on other calendars, such as a lunar calendar.
- Classes dealing with accessing and processing data stored in a database can be found in the java.sql package. The DataBaseMetaData class allows the user to probe a given data base and discover the data types found there in order to provide accurate queries and modifications. The ResultSet class returns all the data in column and maps it onto a java data type. It may also update the data in a column.