For JDK1.2 and above, all the Java class library packages are kept in a file named “scr.jar‰. In the java.awt package there is also another package called. You will notice a package java.awt contains declaration class for Component, Container and Panel. Java class library is organised based on „package keyword‰ such as java.lang, java.util, java.awt and so on. That directory may contain other package (sub package) that is related to that particular package (super package).
A package is put into a directory that contains related declared class. Each package provides a specific function for a particular task or operation. A package is an important part of building a class library. A package makes it easier for us to organise the task and to separate the task from the library provided by others. Java enables us to classify the classes in one logical group that is called a package.
HOW TO CLASSIFY COLORS USING WEKA JAR IN JAVA HOW TO
This chapter will discuss in detail the different types of Java class library and how to use it in programming. Java provides a lot of class library for many different tasks in programming such as mathematical operation, organisation, sequence, graphic, multithreading and network. This is the encapsulation features in Java programming. The only thing we need to know is just the syntax on how to access the methods in that class. We can still use Pembaca class without knowing how the class was made. For example, the class library that we used previously in Appendix 2 is the Pembaca class. We can use the class that is readily available in the class library provided by JDK. We may not need to write all the classes that are required in a program. While the programming is being done, the object of the class is created and destroyed according to the need of the program. INTRODUCTION Java programming starts with creating a class. Write a program that will demonstrate the usage of creating object, composition and subclass. LEARNING OUTCOMES By the end of this topic, you should be able to: 1.ĭescribe of how classes in Java library can be used and