Java Programming language, Tutorials, Tools and Applets

Information Technology Resources

Java is an object-oriented programming language developed by James Gosling and colleagues at Sun Microsystems in the early 1990s. Unlike conventional languages which are generally designed to be compiled to native code, Java is compiled to a bytecode which is then run (generally using JIT compilation) by a Java virtual machine

The language itself borrows much syntax from C and C++ but has a much simpler object model and does away with low level tools like programmer-manipulable pointers. Java is only distantly related to JavaScript, though they have similar names and share a C-like syntax.

There were five primary goals in the creation of the Java language:

1. It should use the object-oriented programming methodology.

2. It should allow the same program to be executed on multiple operating systems.

3. It should contain built-in support for using computer networks.

4. It should be designed to execute code from remote sources securely.

5. It should be easy to use and borrow the good parts of older object-oriented languages like C++.

To achieve the goals of networking support and remote code execution, Java programmers sometimes find it necessary to use extensions such as CORBA, Internet Communications Engine, or OSGi.

Object orientation

The first characteristic, object orientation ("OO"), refers to a method of programming and language design. Although there are many interpretations of OO, one primary distinguishing idea is to design software so that the various types of data it manipulates are combined together with their relevant operations. Thus, data and code are combined into entities called objects. An object can be thought of as a self-contained bundle of behavior (code) and state (data). The principle is to separate the things that change from the things that stay the same; often, a change to some data structure requires a corresponding change to the code that operates on that data, or vice versa. This separation into coherent objects provides a more stable foundation for a software system's design. The intent is to make large software projects easier to manage, thus improving quality and reducing the number of failed projects.

Another primary goal of OO programming is to develop more generic objects so that software can become more reusable between projects. A generic "customer" object, for example, should in theory have roughly the same basic set of behaviors between different software projects, especially when these projects overlap on some fundamental level as they often do in large organizations. In this sense, software objects can hopefully be seen more as pluggable components, helping the software industry build projects largely from existing and well tested pieces, thus leading to a massive reduction in development times. Software reusability has met with mixed practical results, with two main difficulties: the design of truly generic objects is poorly-understood, and a methodology for broad communication of reuse opportunities is lacking. Some open source communities want to help ease the reuse problem, by providing authors with ways to disseminate information about generally reusable objects and object libraries.

Platform independence

The look and feel of Java Swing GUIs is independent of the platform on which they are runningThe second characteristic, platform independence, means that programs written in the Java language must run similarly on diverse hardware. One should be able to write a program once and run it anywhere.

This is achieved by most Java compilers by compiling the Java language code "halfway" to bytecode (specifically Java bytecode)—simplified machine instructions specific to the Java platform. The code is then run on a virtual machine (VM), a program written in native code on the host hardware that interprets and executes generic Java bytecode. Further, standardized libraries are provided to allow access to features of the host machines (such as graphics, threading and networking) in unified ways. Note that, although there's an explicit compiling stage, at some point, the Java bytecode is interpreted or converted to native machine instructions by the JIT compiler.

There are also implementations of Java compilers that compile to native object code, such as GCJ, removing the intermediate bytecode stage, but the output of these compilers can only be run on a single architecture.

Sun's license for Java insists that all implementations be "compatible". This resulted in a legal dispute with Microsoft after Sun claimed that the Microsoft implementation did not support the RMI and JNI interfaces and had added platform-specific features of their own. Sun sued and won both damages (some $20 million) and a court order enforcing the terms of the license from Sun. In response, Microsoft no longer ships Java with Windows, and in recent versions of Windows, Internet Explorer cannot support Java applets without a third-party plugin. However, Sun and others have made available Java run-time systems at no cost for those and other versions of Windows.

The first implementations of the language used an interpreted virtual machine to achieve portability. These implementations produced programs that ran more slowly than programs written in C or C++, so the language suffered a reputation for poor performance. More recent JVM implementations produce programs that run significantly faster than before, using multiple techniques.

The first technique is to simply compile directly into native code like a more traditional compiler, skipping bytecodes entirely. This achieves good performance, but at the expense of portability. Another technique, known as just-in-time compilation (JIT), translates the Java bytecodes into native code at the time that the program is run. More sophisticated VMs use dynamic recompilation, in which the VM can analyze the behavior of the running program and selectively recompile and optimise critical parts of the program. Dynamic recompilation can achieve optimizations superior to static compilation because the dynamic compiler can base optimizations on knowledge about the runtime environment and the set of loaded classes. JIT compilation and dynamic recompilation allow Java programs to take advantage of the speed of native code without losing portability.

Portability is a technically difficult goal to achieve, and Java's success at that goal has been mixed. Although it is indeed possible to write programs for the Java platform that behave consistently across many host platforms, the large number of available platforms with small errors or inconsistencies led some to parody Sun's "Write once, run anywhere" slogan as "Write once, debug everywhere".

Platform-independent Java is however very successful with server-side applications, such as Web services, servlets, and Enterprise JavaBeans, as well as with Embedded systems based on OSGi, using Embedded Java environments.

Automatic garbage collection

One possible argument against languages such as C++ is that programmers should be spared the burden of having to perform manual memory management. In C++, the programmer must allocate memory to create any object stored on the heap, and deallocate memory to delete any such objects. If a programmer forgets to deallocate memory or writes code that fails to do so in a timely fashion, a memory leak can occur: the program will consume a potentially arbitrarily large amount of memory. In addition, if a region of memory is deallocated twice, the program can become unstable and may crash.

In Java, this potential problem is avoided by automatic garbage collection. The programmer determines when objects are created and the Java runtime is responsible for managing the objects' lifecycle. The program or other objects can reference an object by holding a reference to it (which, from a low-level point of view, is its address on the heap). When no references to an object remain, the Java garbage collector automatically deletes the unreachable object, freeing memory and preventing a memory leak. Memory leaks may still occur if a programmer's code holds a reference to an object that is no longer needed—in other words, they can still occur but at higher conceptual levels. On the whole, Java's automatic garbage collection makes creation and deletion of objects in Java simpler, potentially safer, and often faster than in C++.

Garbage collection in Java is virtually invisible to the developer. That is, developers may have no notion of when garbage collection will take place as it may not necessarily correlate with any actions being explicitly performed by the code they write.

Note that memory is only one of many resources which must be managed.

Java.Sun.com : The Java 2 Platform provides robust end-to-end solutions for networked applications as well as a trusted standard for embedded applications. It includes three editions.. Browse through the latest information and technology developments from the Home page of Sun Micro Systems.

O'Reilly Java Java Cryptography teaches you how to write secure programs using Java's cryptographic tools. It includes thorough discussions of the java.security package and the Java Cryptography Extensions (JCE), showing you how to use security providers and even implement your own provider. It discusses authentication, key management, public and private key encryption, and includes a secure talk application that encrypts all data sent over the network. If you work with sensitive data, you'll find this book indispensable

EarthWeb: Java The internet.com and EarthWeb.com Network is a comprehensive source for the latest global Internet news and information about the Internet. They allow users to evaluate, compare and purchase Internet-related products and services. The internet.com and EarthWeb.com Network attracts an experienced Internet community looking for Real-time Internet industry news, Tutorials, training and skills development Internet market research and more.

Sun's Java Developer Connection Use this site to find the latest technical information about JavaTM technology. Registration is required to access certain areas. Search the database, submit new bugs and vote on what bugs you want fixed. Subscribe to Bug Watch for notification on bug fixes.

Java Tutorial, The : The Tutorial is organized into trails--groups of lessons on a particular subject. This Tutorial contains information on the 1.0, 1.1, 1.2, 1.3, and 1.4 versions of the Java Platform, Standard Edition. Release information is provided on an individual trail/lesson basis. All of the material in The Java Tutorial is copyright-protected and may not be published in other works without express written permission from Sun Microsystems.

Microsoft Technologies for Java This release includes the latest versions of the Java compiler (JVC), development tools, samples, and full documentation. Although this SDK is targeted for Microsoft Windows 2000 developers, it is fully backward compatible with the Microsoft Windows 95, Windows 98, Microsoft Windows Millennium Edition (Me), Microsoft Windows NT® 4.0 and Microsoft Windows XP developer environments.

Java Applet Rating Service (JARS) JARS rates Java based applets and applications and other Internet related software. We also rate commercial and personal Web pages containing the use of these technologies, although policy dictates that these be scored as a general "rated" rating unless they have distinguished themselves with quality, unique, and innovative applets. The JARS Java resource section contains a wide selection of Java resources submitted to JARS. You can browse the various sub-sections to find what you may be looking for or you can try locating it through the JARS search engine.

Java Boutique Offers a good collection of Tutorials for the experienced and the novice and Reviews containing summaries of the latest Java books, IDEs, and other tools and products for programmers and non-programmers alike. The Development Tools section contains up-to-date listing of Integrated Development Environments and other development tools. The FAQ section contains answers to java related questions.

Java Foundation Classes The Java Foundation Classes (JFC) software extends the original Abstract Window Toolkit (AWT) by adding a comprehensive set of graphical user interface class libraries. The most recent supported release containing JFC API is Java 2 SDK, Standard Edition, (J2SE) v 1.4. If you must use JDK 1.1, you can get old implementations of some of the JFC features by downloading JFC 1.1.

Forte for Java Developer Resources Contains Downloads, Code Samples, Search, bug tracking, early access program, downloads, and documentation for Java developers.

Anfy Java: Anfy 2.0 includes 52 applets using Java™ technology, ultimate effects and navigational menu for web sites. Usable also as screensaver. Download Anfy for Windows, Mac, Linux. On this site you can download and use FOR FREE a couple of programs for graphic artists and web designers. Usable as screen saver too!

Java Grande The goal of the Java Grande Forum (JGF) is to develop community consensus and recommendations for either changes to Java or establishment of standards (frameworks) for Grande libraries and services. These language changes or frameworks are designed to realize the best ever usability of Grande programming environment.

PowerPC/AIX Port Project The goal of this project is to provide a full-featured and certifiable version of OpenJDK on the Linux/PowerPC and AIX/PowerPC platforms which can be ultimately integrated into the main OpenJDK development branches.

Java Advanced Imaging API The JavaTM Advanced Imaging application programming interface (API) enables developers to easily incorporate high-performance, network-enabled, scalable, platform-independent image processing into Java technology-based applications and applets. By using the inherent stengths of the Java language, Java Advanced Imaging extends the concept of "Write Once, Run AnywhereTM" to image processing applications.

Java Cryptography: Java Cryptography teaches you how to write secure programs using Java's cryptographic tools. It includes thorough discussions of the java.security package and the Java Cryptography Extensions (JCE), showing you how to use security providers and even implement your own provider. It discusses authentication, key management, public and private key encryption, and includes a secure talk application that encrypts all data sent over the network.

Java Telnet Applet: The Java(tm) Telnet Applet is a fully featured telnet program that allows users to connect and login to remote hosts via Internet or Intranet using their WWW-Browser only. Not only it includes telnet compliant connection services, but also the ability to dynamically load additional Terminal Emulations and Modules. Look at our test page to see how the applet works or download the package. This software is available under the terms of the GNU General Public License as documented in the file COPYING. The site has a new url and is under construction but already usable.

Java Naming and Directory Interface (JNDI): The Java Naming and Directory InterfaceTM (JNDI) is a standard extension to the JavaTM platform, providing Java technology-enabled applications with a unified interface to multiple naming and directory services in the enterprise. As part of the Java Enterprise API set, JNDI enables seamless connectivity to heterogeneous enterprise naming and directory services. Developers can now build powerful and portable directory-enabled applications using this industry standard.

jCIFS: CIFS in Java: This project is dedicated to the design and implementation of CIFS solutions using the Java programming language. A complete, robust, and extensible thread-safe client library has been implemented. This client will enable any Java VM to access resources on CIFS/SMB networks. The java.io.File-like interface is easy to use and has proven to be quite efficient, particularly in a multi-threaded environment.

JPowered.com: If you want to improve your web site then you have come to the right place. We have high quality Java™ applets, servlets and DHTML JavaScript which will add a dynamic feel to your site and make your pages far more interactive. Whether you are looking for an applet to plug into your web page or an applet programmer looking for a little inspiration then why not check out our pre-built applets. We provide a fully functioning trial version for every applet listed below and the source is also available.

CodeBrain.com: The CodeBrain site is comprised of some 450+ pages, devoted to JAVA, Perl, JavaScript, and web site development resources and issues. Contains very useful ready to use java applets for your use. Some of the applets are for sale and some are free to download. CodeBrain is constantly adding new scripts, applets, and software. If you do not receive our newsletter, now might be a good time to subscribe.

FreeJava: FreewareJava is well organized website with quality applets. The list is constantly updated, and many new featuers and appletes are added to make it ever interesting and useful. If you are looking for some rare applets search this website.

CodeGuru: Welcome to the CodeGuru website, the online community of software developers. While you are here you can also browse the online version of Thinking in Java. You can also post your programming questions on the discussion board. We welcome code submissions: If you've written a cool piece of code, please share it with others.There are 675 links for you to choose from!

ColdBeans : Formerly ColdJava, Coldbeans Software* implemented next version of servlets office suite (JSOS). This product is a collection of servlets for Java(tm) technology "out of the box" ready for building web-pages. JSOS plays the same role as a set of CGI scripts and can be used by webmasters for adding dynamic capabilities to their sites. JSOS has a rich set of servlets such as Message Board, Chat, File Manager, Calendar etc. And now WAP/WML is also supported.

FreewareJava : Welcome to Freewarejava.com, an excellent starting point to everything Java™ technology on the net! Java applets of various types to add Java power to your site. If you're a Java developer, learn from their source codes. Tutorials and online courses on Java learning. (Commercial) sites devoted exclusively to Java. Great way to keep up with the latest happenings in the Java Community. Java books, complete online versions of Java books.

HotScripts.com HotScripts.com is an Internet directory that compiles and distributes Web programming-related resources. HotScripts.com is geared toward webmasters and programmers who are looking to enhance their Web sites and intranets with dynamic development tools. With thousands of Web programming resources available on the Internet today, our mission is to provide Web developers with the best collection of quality programming information and resources in the most convenient fashion.

Java Applet Collection by Sirius. If you want to improve your web site then you have come to the right place. We have high quality Java™ applets, servlets and DHTML JavaScript which will add a dynamic feel to your site and make your pages far more interactive. Whether you are looking for an applet to plug into your web page or an applet programmer looking for a little inspiration then why not check out our pre-built applets. We provide a fully functioning trial version for every applet listed below and the source is also available.

Suggestions for Further Reading

Translate the Page

Search Hinduwebsite

Follow Us