Tuesday, December 3, 2019
JAVA INCLUDES A LIBRARY OF CLASSES AND INTERFACES Essays
JAVA INCLUDES A LIBRARY OF CLASSES AND INTERFACES: The Java platform includes an extensive class library so that programmers can use already existing classes, as it is, create subclasses to modify existing classes, or implement interfaces to augment the capabilities of classes. Both classes and interfaces contain data members (fields) and functions (methods), but there are major differences. In a class, fields may be either variable or constant, and methods are fully implemented. To use an interface, a programmer defines a class, declares that it implements the Interface, and then implements all the methods in that interface as part of the class. These methods are implemented in a way that is appropriate for the class in which the methods are being used. Interfaces let one add functionality to a class and give a great deal of flexibility in doing it. A package is a collection of related Java classes and interfaces. The following list, however not complete, gives example of some Java packages and what they cover. Java.lang: The basic classes. This package is so basic that it automatically is included in any Java program. It includes classes that intercepts with numeric, strings, objects, runtime, security, and threads. Java.io: Package that includes classes managing reading data in input streams and writing data into output streams. Java.util: Miscellaneous utility classes, including generic data structures, bit sets, time, date, the string manipulation, random number generation, system properties, notification and enumeration of data structures. Java.net: Classes for network support. Java.awt: Classes that manage user interface components such as windows, dialog boxes, buttons, checkboxes, lists, menus, scrollbars, and text fields, the AWT stands for Abstract Window Toolkit. Java.awt.image: Classes for managing image data, including color models, dropping color flittering, setting pixel values, and grabbing snapshots. Java.applet: The Applet class, which provides the ability to write applets, this package also includes several interfaces that connect an applet to its documents and to its document. Java.sql: The JDBC API, classes and interfaces that access databases and send SQL Statements. The first three packages listed, java.lang, java.io and java.util form the basis, they are basic classes and interfaces for general-purpose programming. Java development kit version1.1 added some new packages, with JDBC being one of them. Other new packages include such thing as Remote Method Invocation, Security and Java Beans, the new API for creating reusable components. In Java, packages serve as the foundation for building other packages, as discussed in the following section. JAVA IS EXTENSIBLE: A big plus for Java is the fact it can be extended. It was purposely written to be lean with the emphasis on doing what it does very well, instead of trying to do everything from the beginning, it was return so that extending it is very simple. The JDBC API, the java.sql package, is one example upon which extensions are being built. In addition to extensions there are also main tools being developed to make existing capabilities easier to use. For example, there is already a tool that greatly Simplifies creating and laying out Graphical User Interfaces such as menus, Dialog boxes and buttons. SECURITY: It is important that a programmer not be able to write subversive code for Applications or applets. This is especially true with the Internet being used more and more extensively for services such as electronic commerce and electronic delivery of software and multimedia content. The Java platform builds in security in four ways. The way memory is Allocated and laid out: In Java an objects location in memory is not determined until The runtime, as opposed to C and C++, where the compiler makes memory layout Decisions. As the result, a programmer cannot look at a class definition and figure out how it might be laid out in memory. Also since, Java has no pointers, a programmer cannot forge pointers to memory. The way incoming code is checked: The Java virtual machine doesnt trust any incoming code and subjects it to what is called throughte code verification. The throughte code Verifier, part of the virtual machine, checks that the format of incoming code is correct incoming code doesnt forge pointers, it doesnt violate access restrictions, it accesses objects what they are. The way classes are loaded: The Java throughte code loader, another part of the virtual machine, whether classes loaded during program execution are local or from across a network. Imported
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.