JAVA CODE
JAVA PROGRAMME
Java Basics
Working with Objects
Arrays, Conditionals, and Loops
Creating Classes and Applications in Java
More About Methods
Java Applet Basics
Graphics, Fonts, and Color
Simple Animation and Threads
More Animation, Images, and Sound
Managing Simple Events and Interactivity
Creating User Interfaces with the awt
Windows, Networking, and Other Tidbits
Modifiers, Access Control, and Class Design
Packages and Interfaces
Exceptions
Multithreading
Streams and I/O
Using Native Methods and Libraries
Under the Hood
Java Programming Tools
Working with Data Structures in Java
Advanced Animation and Media
Fun with Image Filters
Client/Server Networking in Java
Emerging Technologies
appendix A :- Language Summary
appendix B :- Class Hierarchy Diagrams
appendix C The Java Class Library
appendix D Bytecodes Reference
appendix E java.applet Package Reference
appendix F java.awt Package Reference
appendix G java.awt.image Package Reference
appendix H java.awt.peer Package Reference
appendix I java.io Package Reference
appendix J java.lang Package Reference
appendix K java.net Package Reference
appendix L java.util Package Reference

Java's Past, Present, and Future

The Java language was developed at Sun Microsystems in 1991 as part of a research project to develop software for consumer electronics devices-television sets, VCRs, toasters, and the other sorts of machines you can
buy at any department store. Java’s goals at that time were to be small, fast, efficient, and easily portable to a wide range of hardware devices. Those same goals made Java an ideal language for distributing executable
programs via the World Wide Web and also a general-purpose programming language for developing programs that are easily usable and portable across different platforms.

The Java language was used in several projects within Sun (under the name Oak), but did not get very much commercial attention until it was paired with HotJava. HotJava, an experimental World Wide Web browser,
was written in 1994 in a matter of months, both as a vehicle for downloading and running applets and also as an example of the sort of complex application that can be written in Java. Although HotJava got a lot of
attention in the Web community, it wasn’t until Netscape incorporated HotJava’s ability to play applets into its own browser that Java really took off and started to generate the excitement that it has both on and off the
World Wide Web. Java has generated so much excitement, in fact, that inside Sun the Java group spun off into its own subsidiary called JavaSoft.

Versions of Java itself, or, as it’s most commonly called, the Java API, correspond to versions of Sun’s Java Developer’s Kit, or JDK. As of this writing, the current version of the JDK is 1.0.2. Previously released
versions of the JDK (alphas and betas) did not have all the features or had a number of security-related bugs. Most Java tools and browsers conform to the features in the 1.0.2 JDK, and all the examples in this book run
on that version as well.

The next major release of the JDK and therefore of the Java API will be 1.1, with a prerelease version available sometime in the later part of 1996. This release will have few changes to the language, but a number of
additional capabilities and features added to the class library. Throughout this book, if a feature will change or will be enhanced in 1.1, we’ll let you know, and in the last two days of this book you’ll find out more about
new Java features for 1.1 and for the future.

Currently, to program in Java, you’ll need a Java development environment of some sort for your platform. Sun’s JDK works just fine for this purpose and includes tools for compiling and testing Java applets and
applications. In addition, a wide variety of excellent Java development environments have been developed, including Sun’s own Java Workshop, Symantec’s CafĂ©, Microsoft’s Visual J++ (which is indeed a Java tool,
despite its name), and Natural Intelligence’s Roaster, with more development tools appearing all the time.

To run and view Java applets, you’ll need a Java-enabled browser or other tool. As mentioned before, recent versions of Netscape Navigator (2.0 and higher) and Internet Explorer (3.0) can both run Java applets. (Note
that for Windows you’ll need the 32-bit version of Netscape, and for Macintosh you’ll need Netscape 3.0.) You can also use Sun’s own HotJava browser to view applets, as long as you have the 1.0 prebeta version
(older versions are not compatible with newer applets, and vice versa). Even if you don’t have a Java-enabled browser, many development tools provide simple viewers with which you can run your applets. The JDK
comes with one of these; it’s called the appletviewer.

Note
If you’re running Windows 3.x as your main system, very few tools exist for you to be able to work with Java. As I write this, the only Java tool available for writing and
running Java applets is a version of the JDK from IBM called the ADK. You can write applets using this tool, and view them using the applet viewer that comes with
that package (neither Netscape nor Internet Explorer will run Java applets on Windows 3.1). See http://www.alphaWorks.ibm.com/ for more information.

What’s in store for Java in the future? A number of new developments have been brewing (pardon the pun):
Sun is developing a number of new features for the Java environment, including a number of new class libraries for database integration, multimedia, electronic commerce, and other uses. Sun also has a Java-based
Web server, a Java-based hardware chip (with which you can write Java-specific systems), and a Java-based operating system. You’ll learn about all these things later in this book. The 1.1 release of the JDK will
include many of these features; others will be released as separate packages.
Sun is also developing a framework called Java Beans, which will allow the development of component objects in Java, similarly to Microsoft’s ActiveX (OLE) tech-nology. These different components can then be
easily combined and interact with each other using standard component assembly tools. You’ll learn more about Java Beans later in this book.
Java capabilities will be incorporated into a wide variety of operating systems, including Solaris, Windows 95, and MacOS. This means that Java applications (as opposed to applets) can run nearly anywhere
without needing additional software to be installed.
Many companies are working on performance enhancements for Java programs, including the aforementioned Java chip and what are called just-in-time compilers.

prime number
Scroll to Top