Java uses an automatic garbage collector to manage memory in the object lifecycle. The programmer determines when objects are created, and the Java runtime is responsible for recovering the memory once objects are no longer in use. Once no references to an object remain, the unreachable object becomes eligible to be freed automatically by the garbage collector. Something similar to a memory leak may still occur if a programmer's code holds a reference to an object that is no longer needed, typically when objects that are no longer needed are stored in containers that are still in use. If methods for a nonexistent object are called, a "null pointer exception" is thrown.
One of the ideas behind Java's automatic memory management model is that programmers be spared the burden of having to perform manual memory management. In some languages memory for the creation of objects is implicitly allocated on the stack, or explicitly allocated and deallocated from the heap. Either way the responsibility of managing memory resides with the programmer. If the program does not deallocate an object, a memory leak occurs. If the program attempts to access or deallocate memory that has already been deallocated, the result is undefined and difficult to predict, and the program is likely to become unstable and/or crash. This can be partially remedied by the use of smart pointers, but these add overhead and complexity.
Garbage collection may happen at any time. Ideally, it will occur when a program is idle. It is guaranteed to be triggered if there is insufficient free memory on the heap to allocate a new object; this can cause a program to stall momentarily. Where performance or response time is important, explicit memory management and object pools are often used.
Java does not support C/C++ style pointer arithmetic, where object addresses and unsigned integers (usually long integers) can be used interchangeably. This allows the garbage collector to relocate referenced objects, and ensures type safety and security.
As in C++ and some other object-oriented languages, variables of Java's primitive types are not objects. Values of primitive types are either stored directly in fields (for objects) or on the stack (for methods) rather than on the heap, as commonly true for objects (but see Escape analysis). This was a conscious decision by Java's designers for performance reasons. Because of this, Java was not considered to be a pure object-oriented programming language. However, as of Java 5.0, autoboxing enables programmers to proceed as if primitive types are instances of their wrapper classes
Thursday, July 23, 2009
Automatic memory management
Thursday, July 9, 2009
What's New
The Java Tutorials are continuously updated to keep up with changes to the Java Platform and to incorporate feedback from our readers. Some recent updates include:
An entirely reworked File I/O lesson, featuring NIO.2. This functionality is part of JDK7, which is available now through the Open JDK project on java.net.
A new specialized trail covering Sockets Direct Protocol, also new in JDK7.
A new facility for gathering feedback about the tutorial. At the bottom of each tutorial page, under the "Discuss" heading, you can leave a publicly viewable, blog-style comment. Let us know what you think about the inclusion of this JS-Kit mechanism.
Trails Covering the Basics
These trails are available in book form as The Java Tutorial, Fourth Edition. To buy this book, refer to the box to the right.
Getting Started — An introduction to Java technology and lessons on installing Java development software and using it to create a simple program.
Learning the Java Language — Lessons describing the essential concepts and features of the Java Programming Language.
Essential Java Classes — Lessons on exceptions, basic input/output, concurrency, regular expressions, and the platform environment.
Collections — Lessons on using and extending the Java Collections Framework.
Swing — An introduction to the Swing GUI toolkit, with an overview of features and a visual catalog of components. See below for a more comprehensive tutorial on Swing.
Deployment — How to package applications and applets using JAR files, and deploy them using Java Web Start and Java Plug-in.
Preparation for Java Programming Language Certification — List of available training and tutorial resources.
Creating Graphical User Interfaces
This trail is available in book form as The JFC Swing Tutorial. To buy this book, refer to the box to the right.
--------------------------------------------------------------------------------
The Swing examples are bundled to be open and run in NetBeans IDE. (Of course you can import the source files into any IDE that you wish.) For more information, see Running Tutorial Examples in NetBeans IDE. Each Swing lesson has a separate Examples Index — for a sample, check out the Using Swing Components Examples Index.
--------------------------------------------------------------------------------
Creating a GUI with Swing — A comprehensive introduction to GUI creation on the Java platform.
Specialized Trails and Lessons
These trails and lessons are only available as web pages.
Custom Networking — An introduction to the Java platform's powerful networking features.
The Extension Mechanism — How to make custom APIs available to all applications running on the Java platform.
Full-Screen Exclusive Mode API — How to write applications that more fully utilize the user's graphics hardware.
Generics — An enhancement to the type system that supports operations on objects of various types while providing compile-time type safety. Note that this lesson is for advanced users. The Java Language trail contains a Generics lesson that is suitable for beginners.
Internationalization — An introduction to designing software so that it can be easily be adapted (localized) to various languages and regions.
JavaBeans — The Java platform's component technology.
JDBC Database Access — Introduces an API for connectivity between the Java applications and a wide range of databases and a data sources.
JMX— Java Management Extensions provides a standard way of managing resources such as applications, devices, and services.
JNDI— Java Naming and Directory Interface enables accessing the Naming and Directory Service such as DNS and LDAP.
RMI — The Remote Method Invocation API allows an object to invoke methods of an object running on another Java Virtual Machine.
Reflection — An API that represents ("reflects") the classes, interfaces, and objects in the current Java Virtual Machine.
Security — Java platform features that help protect applications from malicious software.
Sound — An API for playing sound data from applications.
2D Graphics — How to display and print 2D graphics in applications.
Sockets Direct Protocol — How to enable the Sockets Direct Protocol to take advantage of InfiniBand.
Wednesday, April 15, 2009
Trucking Software
Trucking industry has seen a paramount change in its overall functioning, after the inclusion of software technology in its system. Trucking software has significantly improved the day-to-day functioning of the trucking companies. Handling of the trucking business was made apparently simple and easy by this software. Various features of the trucking software are devised, in accordance with the current scenario of the trucking industry. Trucking software has turn out to be an advanced technological device, which is significantly contributing in the efficiency enhancement of the whole transportation system.
Trucking software is specifically designed to address all the intricate issues related to the trucking business. Its special features are in absolute compliance with the needs and requirements of this business. This software has systematically classified all its essential features, in-order to provide a clear picture and a better understanding of the overall business activity of its user. Some of its sorted out special features are as follows:-
• Description of a truck’s journey by the factors of date and time,
• Name of the place of origin or destination of a journey;
• Truck number or the load number;
• Prevailing status of the load, like whether the load is on-route or delivered;
• Date or period of particular trading activity etc.
All these essential features can be availed or utilized by a trucking company to efficiently manage its business. These features not only help a company to keep a track on its business activities, but also enable it to systematically arrange and preserve all the important records related to the trucking business.
Trucking software also provides certain important features related to the document management system of the trucking business. Trucking accounts required for audit and tax purposes can be effectively maintained through the accounting segment of this software. This accounting segment was made highly user friendly, so that even ordinary individuals, without professional expertise can also access it with a substantial degree of convenience. Other essential features like invoice records, and payment reports can also be maintained through this software. Apart from these, there are various small but significant features, which help the owners of trucking companies to impart greater efficiency in the functioning of their businesses.
Over the years there has been a great improvement in the design, features and segmentation of the trucking software. The web based trucking software is the latest and the most advanced version of this technology. The future innovations in the field of trucking business would greatly depend upon the web based trucking software. In conclusion, it can be said that, the trucking software is undoubtedly contributing in the progress and advancement of the whole trucking industry.
source from http://www.articlerich.com/Article/Trucking-Software---Special-Features/536639
Thursday, August 7, 2008
JFC
JFC -- Expanding On A Solid Foundation
The JFC represents a significant introduction of new functionality to the Java development environment. The release of these classes with JDK 1.1 marks the beginning of major enhancements that will continue to improve the completeness and functionality of Java GUI applications.
Additions to the Java Foundation Classes will soon incorporate several features that further enhance a developer's ability to deliver scalable, commercial-grade applications. These new features will be made available to developers as they are completed over the next few months and then rolled into the next release of the JDK.
New features will include:
* Drag and Drop
* New High-Level Components
* Pluggable Look and Feel
* Java 2D API
* Accessibility Features for the Physically Challenged
* Additional new features continually being added
Drag and Drop
The Drag and Drop specification is available in the JDK 1.1 documentation and will soon be released as an update to the JFC. Drag and Drop (D&D) functionality as part of the core JFC class library means it will be available on all Java platforms in a consistent and supported fashion. It will significantly improve application interoperability by enabling D&D between Java applications and non-Java applications.
The generic, platform-independent implementation of D&D will enable objects to be dragged and dropped from one application to another. This update will support D&D between two Java applications, but more importantly, it will support D&D between a Java application and a native application. This means a user running the application on UNIX will be able to D&D to a Motif application and then run the same code on Microsoft-Windows and D&D to native application running there. D&D support makes it much easier to introduce Java applications to the enterprise.
New Java Foundation Classes Components
Working closely with Netscape and IBM, Sun will soon release an expanded set of components written in 100% Pure Java that will enable applications to be more fully integrated into the native environments. These new high-level components will be available on all platforms as part of the standard Java platform, thereby eliminating the need to download extra classes. In addition, new JFC components will carry two important attributes: all components will be both lightweight and peerless, thus facilitating a customizable look and feel without relying on native windowing systems or adding system overhead, and improving the deployment of applications will be simplified.
This comprehensive set of new high-level components will allow developers to create sophisticated professional-quality applets and applications using core JDK 1.1 functionality. The following components will be included with JFC:
Saturday, May 17, 2008
Java Is Important To the Internet
The Internet helped catapult Java to the forefront of programming and Java in turn has a profound effect on the Internet. The reason is simple: Java expands the universe of objects that can move about freely in cyberspace. In a network, there are two broad categories of objects transmitted between the server and your personal Computer. Passive information and dynamic, active programs. For example, when you read your e-mail, you are viewing passive data. Even when you download a program, the program’s code is still only passive data until you execute it
However, there is a second type of object that can be transmitted to your computer. A dynamic, self-executing program. Such a program would be an active agent on the client computer, yet the server would initiate it. As desirable as dynamic, networked programs are, they also present serious problems in the areas of security and portability. Prior to Java cyberspace was effectively closed to half the entities that now live there. Java addressed these concerns and doing so, has opened the door to an exiting a new form of program.
Exception Handling:
An exception is an abnormal condition that arises in a code sequence at run time. In other words, an exception is a run-time error.
Exception-Handling Fundamentals:
A Java exception is an object that describes an exceptional (that is, error) condition that has occurred in a piece of code. When an exceptional condition arises, an object representing that exception is created and thrown in the method that caused the error.exceptions can be generated by the Java run-time system, or they can be manually generated by your code. Exceptions thrown by Java relate to fundamental errors that violate the rules of the Java language or the constraints of the Java execution environment. Manually generated exceptions are typically used to report some error condition to the caller of a method.
Wednesday, April 23, 2008
To address the needs of developers who wanted to create commercial applications that behave and appear identical across all platforms, Netscape created the Internet Foundation Classes (IFC). While IFC was a robust framework which delivered many important functionalities to the development community, Java developers demanded a single industry standard solution
As a result, Sun, Netscape, and IBM joined force to create Java Foundation Classes which provides a single GUI component and services solution. Java Foundation Classes builds on top of the existing AWT by integrating the best of new Sun technologies and Netscape's Internet Foundation Classes.
JFC -- A Comprehensive Set of Classes and Services
With JDK software version 1.1, the web-centric AWT GUI toolkit becomes part of a comprehensive set of GUI classes and services called The Java Foundation Classes. The Java Foundation Classes, a superset of the AWT, provides a robust infrastructure for creating commercial quality intranet and Internet applets and applications. The JFC is the result of developer and end user feedback and provides a significant advance in the development of client applications written in the Java programming language.
The JFC released in JDK 1.1 provides a wide range of new features that enable Java developers to be more productive while delivering applications that are fully integrated into the desktop environment. The JFC contains a powerful, mature delegation event model, printing, clipboard support, a lightweight UI framework and is 100% JavaBeans compliant. The new capabilities of JFC make Java a platform that will support the most sophisticated enterprise applications. Development of commercial applications using Java is now both possible and attractive.
Java and the AWT freed developers from being tied to a specific or proprietary platform for GUI application development and deployment. Today, the JFC provides the core set of classes and services enabling applications to scale from the desktop to the enterprise and across multiple platforms. Java developers will find the additions and improvements to the toolkit greatly enhance their ability to deliver 100% Java applications quickly and provide reliability and cross-platform consistency.
Thursday, April 3, 2008
about java
Native code is code that after you compile it, the compiled code runs on a specific hardware platform. As a platform-independent environment, the Java platform can be a bit slower than native code. However, smart compilers, well-tuned interpreters, and just-in-time bytecode compilers can bring performance close to that of native code without threatening portability
Java was conceived by James Gosling, Patrick Naughton, Chris Warth, EdFrank and Mike Sheridan at SUN Micro systems Incorporation in 1991. It took 18 months to develop the first working version. This language was initially called "OAK", but was renamed "JAVA" in 1995. Before the initial implementation of Oak in 1992 and the public announcement of Java in 1995, many more contributed to the design and evolution of the language.
Java is developed in year 1990 by “Sun micro system” to develop special soft wear that is used to manipulate censurer electronic drivers. In year 1992 “Green project team” win micro system, demonstrated the application of their new language to control list of home application (or) appliances to handle device with any they touch screen. In year 1993 www(world wide web) appeared on the internet and transformed the text – based internet in to graphical –rich environment. The green project team come up with the idea of developing web applets, using the new language. In year 1994 the “green project team” developed a web browser called “Hot Java” demonstrated the power of the new language. In year 1996, java established it self-not only as a leader for Internet programming, but also as general purpose, object – oriented programming language.