Pages

Tuesday, October 14, 2008

PYTHON

Python is a general-purpose, high-level programming language. Its design philosophy emphasizes programmer productivity and code readability.'s core syntax and semantics are minimalistic, while the standard library is large and comprehensive. Its use of whitespace as block delimiters is unusual among popular programming languages.

Python supports multiple programming paradigms (primarily object oriented, imperative, and functional) and features a fully dynamic type system and automatic memory management, similar to Perl, Ruby, Scheme, and Tcl. Like other dynamic languages, Python is often used as a scripting language.

Python was first released by Guido van Rossum in 1991. The language has an open, community-based development model managed by the non-profit Python Software Foundation, which also maintains the de facto standard definition of the language in CPython, the reference implementation.

Version 1.0

Python reached version 1.0 in January 1994. The major new features included in this release were the functional programming tools lambda, map, filter and reduce. Van Rossum stated that “Python acquired lambda, reduce(), filter() and map(), courtesy of (I believe) a Lisp hacker who missed them and submitted working patches.”

The last version released while van Rossum was at CWI was Python 1.2. In 1995, van Rossum continued his work on Python at the Corporation for National Research Initiatives (CNRI) in Reston, Virginia from where he released several versions.

By version 1.4, Python had acquired several new features. Notable among these are the Modula-3 inspired keyword arguments (which are also similar to Common Lisp's keyword arguments), and built-in support for complex numbers. Also included is a basic form of data hiding by name mangling, though this is easily bypassed.

During van Rossum's stay at CNRI, he launched the Computer Programming for Everybody (CP4E) initiative, intending to make programming more accessible to more people, with a basic 'literacy' in programming languages, similar to the basic English literacy and mathematics skills required by most employers. Python served a central role in this: because of its focus on clean syntax, it was already suitable, and CP4E's goals bore similarities to its predecessor, ABC. The project was funded by DARPA.As of 2007, the CP4E project is inactive, and while Python attempts to be easily learnable and not too arcane in its syntax and semantics, reaching out to non-programmers is not an active concern.

BeOpen

In 2000, the Python core development team moved to BeOpen.com to form the BeOpen PythonLabs team. CNRI requested that a version 1.6 be released, summarizing Python's development up to the point at which the development team left CNRI. Consequently, the release schedules for 1.6 and 2.0 had a significant amount of overlap.[11] Python 2.0 was the first and only release from BeOpen.com. After Python 2.0 was released by BeOpen.com, Guido van Rossum and the other PythonLabs developers joined Digital Creations.

The Python 1.6 release included a new CNRI license that was substantially longer than the CWI license that had been used for earlier releases. The new license included a clause stating that the license was governed by the laws of the State of Virginia. The Free Software Foundation argued that the choice-of-law clause was incompatible with the GNU GPL. BeOpen, CNRI, and the FSF negotiated a change to Python's free software license that would make it GPL-compatible. Python 1.6.1 is essentially the same as Python 1.6, with a few minor bug fixes, and with the new GPL-compatible license.

Version 2.0

Python 2.0 introduced list comprehensions, a feature borrowed from the functional programming languages SETL and Haskell. Python's syntax for this construct is very similar to Haskell's, apart from Haskell's preference for punctuation characters and Python's preference for alphabetic keywords. Python 2.0 also introduced a garbage collection system capable of collecting reference cycles.

Python 2.1 was close to Python 1.6.1, as well as Python 2.0. Its license was renamed Python Software Foundation License. All code, documentation and specifications added, from the time of Python 2.1's alpha release on, is owned by the Python Software Foundation (PSF), a non-profit organization formed in 2001, modeled after the Apache Software Foundation. The release included a change to the language specification to support nested scopes, like other statically scoped languages.(The feature was turned off by default, and not required, until Python 2.2.)

A major innovation in Python 2.2 was the unification of Python's types (types written in C), and classes (types written in Python) into one hierarchy. This single unification made Python's object model purely and consistently object oriented. Also added were generators which were inspired by Icon.

Java legacy

Python's standard library additions and syntactical choices were strongly influenced by Java in some cases: the logging package, introduced in version 2.3, the SAX parser, introduced in 2.0, and the decorator syntax that uses @, added in version 2.4

Future development

A Python Enhancement Proposal (or "PEP") is a standardized design document providing general information related to Python, including proposals, descriptions, and explanations for language features. PEPs are intended as the primary channel for proposing new features, and for documenting the underlying design rationale for all major elements of Python. Outstanding PEPs are reviewed and commented upon by van Rossum, the BDFL.

Python 3000

There are plans for a future version, to be called Python 3.0 (the project is called "Python 3000" or "Py3K") that will break backwards compatibility with the 2.x series in order to repair perceived flaws in the language. The guiding principle is to "reduce feature duplication by removing old ways of doing things".

Philosophy

Python 3.0 is being developed with the same philosophy as in prior versions, so any reference to Python philosophy will apply to Python 3.0 as well. However, as Python has accumulated new and redundant ways to program the same task, Python 3.0 has an emphasis on removing duplicative constructs and modules, in keeping with “There should be one—and preferably only one—obvious way to do it”.

Nonetheless, Python 3.0 will remain a multi-paradigm language. Coders will still have options among object orientation, structured programming, functional programming, and aspect-oriented programming and other paradigms, but within such broad choices, the details are intended to be more obvious in Python 3.0 than they have become in Python 2.x.

Timeline and compatibility

The first release candidate of Python 3.0 was released on September 17, 2008.[22] The Python 2.x and Python 3.x series will coexist for several releases in parallel, where the 2.x series exists largely for compatibility and with some new features being backported from the 3.x series. PEP 3000 contains more information about the release schedule.

Python 3.0 will break backward compatibility. There is no requirement that Python 2.x code will run unmodified on Python 3.0. There are basic changes such as changing the print statement into a print function (so any use of print as a statement will cause the program to fail), and switching to Unicode for all text strings. Python's dynamic typing combined with the plans to change the semantics of certain methods of dictionaries, for example, makes perfect mechanical translation from Python 2.x to Python 3.0 very difficult. However, a tool called "2to3" does most of the job of translation, pointing out areas of uncertainty using comments or warnings. Even in an alpha stage, 2to3 appears to be fairly successful at performing the translation.[23] PEP 3000 recommends keeping one source (for the 2.x series), and producing releases for the Python 3.x platform using 2to3. The resulting code should not be edited until the program no longer needs to run on Python 2.x.

Python 2.6 includes forward compatibility features, as well as a "warnings" mode that will warn of potential transition problems. Warnings will be reported for builtins which will no longer exist in 3.0, as well as various old Python 2.x features that Python 3.0 will remove (see PEP 361 for more information).

Features

Some of the major changes scheduled for Python 3.0 are:

  • Changing print so that it is a built-in function, not a statement. This makes it easier to change a module to use a different print function, as well as making the syntax more regular. In Python 2.6 this can be enabled by entering from __future__ import print_function.
  • Moving reduce (but not map or filter) out of the built-in namespace and into functools (the rationale being that operations using reduce are expressed more clearly using an accumulation loop);
  • Adding support for optional function annotations that can be used for informal type declarations or other purposes;
  • Unifying the str/unicode types, representing text, and introducing a separate immutable bytes type; and a mostly corresponding mutable bytearray type, which both represent arrays of bytes;
  • Removing backward-compatibility features, including old-style classes, integer-truncating division, string exceptions, and implicit relative imports.

Friday, September 12, 2008

Network security

Network security consists of the provisions made in an underlying computer network infrastructure, policies adopted by the network administrator to protect the network and the network-accessible resources from unauthorized access and the effectiveness (or lack) of these measures combined together.

Comparison with computer security

Securing network infrastructure is like securing possible entry points of attacks on a country by deploying appropriate defense. Computer security is more like providing means to protect a single PC against outside intrusion. The former is better and practical to protect the civilians from getting exposed to the attacks. The preventive measures attempt to secure the access to individual computers--the network itself--thereby protecting the computers and other shared resources such as printers, network-attached storage connected by the network. Attacks could be stopped at their entry points before they spread. As opposed to this, in computer security the measures taken are focused on securing individual computer hosts. A computer host whose security is compromised is likely to infect other hosts connected to a potentially unsecured network. A computer host's security is vulnerable to users with higher access privileges to those hosts.

Attributes of a secure network

Network security starts from authenticating any user, most likely a username and a password. Once authenticated, a stateful firewall enforces access policies such as what services are allowed to be accessed by the network users. Though effective to prevent unauthorized access, this component fails to check potentially harmful contents such as computer worms being transmitted over the network. An intrusion prevention system (IPS) detect and prevent such malware. IPS also monitors for suspicious network traffic for contents, volume and anomalies to protect the network from attacks such as denial of service. Communication between two hosts using the network could be encrypted to maintain privacy. Individual events occurring on the network could be tracked for audit purposes and for a later high level analysis.

Honeypots, essentially decoy network-accessible resources, could be deployed in a network as surveillance and early-warning tools. Techniques used by the attackers that attempt to compromise these decoy resources are studied during and after an attack to keep an eye on new exploitation techniques. Such analysis could be used to further tighten security of the actual network being protected by the honeypot.


Security management

Security Management for networks is different for all kinds of situations. A small home or an office would only require basic security while large businesses will require high maintenance and advanced software and hardware to prevent malicious attacks from hacking and spamming.

Small homes

Medium businesses

Large businesses

School

  • An adjustable firewall and proxy to allow authorized users access from the outside and inside.
  • A strong Antivirus software and Internet Security Software.
  • Wireless connections that lead to firewalls.
  • CIPA compliance.
  • Supervision of network to guarantee updates and changes based on popular site usage.
  • Constant supervision by teachers, librarians, and administrators to guarantee protection against attacks by both internet and sneakernet sources.

Large Government

  • A strong strong firewall and proxy to keep unwanted people out.
  • A strong Antivirus software and Internet Security Software.
  • Strong encryption, usually with a 256 bit key.
  • Whitelist authorized wireless connection, block all else.
  • All network hardware is in secure zones.
  • All host should be on a private network that is invisible from the outside.
  • Put all servers in a DMZ, or a firewall from the outside and from the inside.
  • Security fencing to mark perimeter and set wireless range to this.

Friday, July 18, 2008

What is .NET?

DEFINITION - .NET is both a business strategy from Microsoft and its collection of programming support for what are known as Web services, the ability to use the Web rather than your own computer for various services. Microsoft's goal is to provide individual and business users with a seamlessly interoperable and Web-enabled interface for applications and computing devices and to make computing activities increasingly Web browser-oriented. The .NET platform includes servers; building-block services, such as Web-based data storage; and device software. It also includes Passport, Microsoft's fill-in-the-form-only-once identity verification service.

The .NET platform was designed to provide:

  • The ability to make the entire range of computing devices work together and to have user information automatically updated and synchronized on all of them
  • Increased interactive capability for Web sites, enabled by greater use of XML (Extensible Markup Language) rather than HTML
  • A premium online subscription service, that will feature customized access and delivery of products and services to the user from a central starting point for the management of various applications, such as e-mail, for example, or software, such as Office .NET
  • Centralized data storage, which will increase efficiency and ease of access to information, as well as synchronization of information among users and devices
  • The ability to integrate various communications media, such as e-mail, faxes, and telephones
  • For developers, the ability to create reusable modules, which should increase productivity and reduce the number of programming errors

According to Bill Gates, Microsoft expects that .NET will have as significant an effect on the computing world as the introduction of Windows. One concern being voiced is that although .NET's services will be accessible through any browser, they are likely to function more fully on products designed to work with .NET code.

Saturday, May 24, 2008

Intrusion Detection Technique For MANETs and WSNs

Mobile ad hoc networks and wireless sensor networks have promised a wide variety of applications. However, they are often deployed in potentially adverse or even hostile environments. Therefore, they cannot be readily deployed without first addressing security challenges. Intrusion detection systems provide a necessary layer of in-depth protection for wired networks. However, relatively little research has been performed about intrusion detection in the areas of mobile ad hoc networks and wireless sensor networks. In this article, first we briefly introduce mobile ad hoc networks and wireless sensor networks and their security concerns. Then, we focus on their intrusion detection capabilities. Specifically, we present the challenge of constructing intrusion detection systems for mobile ad hoc networks and wireless sensor networks, survey the existing intrusion detection techniques, and indicate important future research directions. First we briefly introduce mobile ad hoc networks and wireless sensor networks and their security concerns. Then, we focus on their intrusion detection capabilities. Specifically, we present the challenge of constructing intrusion detection systems for mobile ad hoc networks and wireless sensor networks, survey the existing intrusion detection techniques, and indicate important future research directions.


IDS

An intrusion is defined as a set of actions that compromises confidentiality, availability, and integrity of a system. Intrusion detection is a security technology that attempts to identify those who are trying to break into and misuse a system without authorization and those who have legitimate access to the system but are abusing their privileges. The system can be a host computer, network equipment, a firewall, a router, a corporate network, or any information system being monitored by an intrusion detection system.

An IDS dynamically monitors a system and users’ actions in the system to detect intrusions. Because an information system can suffer from various kinds of security vulnerabilities, it is both technically difficult and economically costly to build and maintain a system that is not susceptible of attacks. Experience teaches us never to rely on a single defensive technique. An IDS, by analyzing the system and users’ operations, in search of undesirable and suspicious activities, may effectively monitor and protect against threats. Generally, there are two types of intrusion detection: misuse-based detection and anomaly based detection.

A misuse-based detection technique encodes known attack signatures and system vulnerabilities and stores them in a database. If a deployed IDS finds a match between current activities and signatures, an alarm is generated. Misuse detection techniques are not effective to detect novel attacks because of the lack of corresponding signatures. An anomaly-based detection technique creates normal profiles of system states or user behaviors and compares them with current activities. If a significant deviation is observed, the IDS raises an alarm. Anomaly detection can detect unknown attacks. However, normal profiles are usually very difficult to build. For example, in a MANET, mobility-induced dynamics make it challenging to distinguish between normalcy and anomaly. It is, therefore, more challenging to distinguish between false alarms and real intrusions. The capability to establish normal profiles is crucial in designing an efficient, anomaly based IDS. As a promising alternative, specification based detection techniques combine the advantages of misuse detection and anomaly detection by using manually developed specifications to characterize legitimate system behaviors.

Saturday, April 19, 2008

Java Bean

JavaBeans are reusable software components for Java that can be manipulated visually in a builder tool. Practically, they are classes written in the Java programming language conforming to a particular convention. They are used to encapsulate many objects into a single object (the bean), so that the bean can be passed around rather than the individual objects.

The specification by Sun Microsystems defines them as "reusable software components that can be manipulated visually in a builder tool".

JavaBean conventions

In order to function as a JavaBean class, an object class must obey certain conventions about method naming, construction, and behavior. These conventions make it possible to have tools that can use, reuse, replace, and connect JavaBeans.

The required conventions are:

  • The class must have a no-argument public constructor. This allows easy instantiation by editing and activation frameworks.
  • Its properties must be accessible using get, set and other methods (so called accessor methods) following a standard naming convention. This allows easy automated inspection and updating of bean state by frameworks, many of which include custom editors for various types of properties.
  • The class should be serializable. This allows applications and frameworks to reliably save, store and restore bean state in a VM and platform independent fashion.

Because these requirements are largely expressed as conventions rather than by implementing interfaces, some developers view Java Beans as Plain Old Java Objects that follow certain naming conventions.

JavaBean Example

// PersonBean.java

public class PersonBean implements java.io.Serializable {

private String name;
private boolean deceased;

// No-arg constructor (takes no arguments).

public PersonBean() {
}

// Property "name" (note capitalization) readable/writable
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}

// Property "deceased"
// Different syntax for a boolean field (is vs. get)
public boolean isDeceased() {
return this.deceased;
}
public void setDeceased(boolean deceased) {
this.deceased = deceased;
}
}
// TestPersonBean.java

public class TestPersonBean {
public static void main(String[] args) {

PersonBean person = new PersonBean();
person.setName("Bob");
person.setDeceased(false);

// Output: "Bob [alive]"
System.out.print(person.getName());
System.out.println(person.isDeceased() ? " [deceased]" : " [alive]");
}
}


Adoption

AWT, Swing, and SWT, the major Java GUI toolkits, use JavaBeans conventions for their components. This allows GUI editors like the Eclipse Visual Editor or the NetBeans GUI Editor to maintain a hierarchy of components and to provide access to their properties via uniformly-named accessors and mutators.

Trivia

Java beans also refers to Coffea arabica.

References

 

Saturday, April 12, 2008

Java

Java is a programming language originally developed by Sun Microsystems and released in 1995 as a core component of Sun Microsystem's Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities. Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of computer architecture.

The original and reference implementation Java compilers, virtual machines, and class libraries were developed by Sun from 1995. As of May 2007, in compliance with the specifications of the Java Community Process, Sun made available most of their Java technologies as free software under the GNU General Public License. Others have also developed alternative implementations of these Sun technologies, such as the GNU Compiler for Java and GNU Classpath.

Philosophy

Primary goals

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 by selecting what were considered the good parts of other object-oriented languages.

Platform independence

One characteristic, platform independence, means that programs written in the Java language must run similarly on any supported hardware/operating-system platform. One should be able to write a program once, compile it once, and run it anywhere.

This is achieved by most Java compilers by compiling the Java language code halfway (to 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. (In some JVM versions, bytecode can also be compiled to native code, either before or during program execution, resulting in faster execution.) 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 is an explicit compiling stage, at some point, the Java bytecode is interpreted or converted to native machine code by the JIT compiler.

The first implementations of the language used an interpreted virtual machine to achieve portability. These implementations produced programs that ran slower than programs compiled to native executables, for instance 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.

One technique, known as just-in-time compilation (JIT), translates the Java bytecode into native code at the time that the program is run, which results in a program that executes faster than interpreted code but also incurs compilation overhead during execution. More sophisticated VMs use dynamic recompilation, in which the VM can analyze the behavior of the running program and selectively recompile and optimize 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, and can identify the hot spots (parts of the program, often inner loops, that take up the most execution time). JIT compilation and dynamic recompilation allow Java programs to take advantage of the speed of native code without losing portability.

Another technique, commonly known as static compilation, is to compile directly into native code like a more traditional compiler. Static Java compilers, such as GCJ, translate the Java language code to native object code, removing the intermediate bytecode stage. This achieves good performance compared to interpretation, but at the expense of portability; the output of these compilers can only be run on a single architecture. Some see avoiding the VM in this manner as defeating the point of developing in Java; however it can be useful to provide both a generic bytecode version, as well as an optimised native code version of an application.

Implementations

Sun Microsystems officially licenses the Java Standard Edition platform for Microsoft Windows, Linux, and Solaris. Through a network of third-party vendors and licensees, alternative Java environments are available for these and other platforms. To qualify as a certified Java licensee, an implementation on any particular platform must pass a rigorous suite of validation and compatibility tests. This method enables a guaranteed level of compliance and platform through a trusted set of commercial and non-commercial partners.

Sun's trademark license for usage of the Java brand 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 in 1997 (some $20 million) and a court order enforcing the terms of the license from Sun. As a result, 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.

Platform-independent Java is essential to the Java Enterprise Edition strategy, and an even more rigorous validation is required to certify an implementation. This environment enables portable server-side applications, such as Web services, servlets, and Enterprise JavaBeans, as well as with Embedded systems based on OSGi, using Embedded Java environments. Through the new GlassFish project, Sun is working to create a fully functional, unified open-source implementation of the Java EE technologies.

Automatic memory management

See also: Garbage collection (computer science)

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 the programmer allocates memory for the creation of objects stored on the heap and the responsibility of later deallocating that memory also resides with the programmer. If the programmer forgets to deallocate memory or writes code that fails to do so, a memory leak occurs and the program can consume an arbitrarily large amount of memory. Additionally, if the program attempts to deallocate the region of memory more than once, the result is undefined and the program may become unstable and may crash. Finally, in non garbage collected environments, there is a certain degree of overhead and complexity of user-code to track and finalize allocations. Often developers may box themselves into certain designs to provide reasonable assurances that memory leaks will not occur.

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 object's 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 unreachable object is eligible for release by the Java garbage collector - it may be freed automatically by the garbage collector at any time. 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.

The use of garbage collection in a language can also affect programming paradigms. If, for example, the developer assumes that the cost of memory allocation/recollection is low, they may choose to more freely construct objects instead of pre-initializing, holding and reusing them. With the small cost of potential performance penalties (inner-loop construction of large/complex objects), this facilitates thread-isolation (no need to synchronize as different threads work on different object instances) and data-hiding. The use of transient immutable value-objects minimizes side-effect programming.

Comparing Java and C++, it is possible in C++ to implement similar functionality (for example, a memory management model for specific classes can be designed in C++ to improve speed and lower memory fragmentation considerably), with the possible cost of adding comparable runtime overhead to that of Java's garbage collector, and of added development time and application complexity if one favors manual implementation over using an existing third-party library. In Java, garbage collection is built-in and 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. Depending on intended application, this can be beneficial or disadvantageous: the programmer is freed from performing low-level tasks, but at the same time loses the option of writing lower level code. Additionally, the garbage collection capability demands some attention to tuning the JVM, as large heaps will cause apparently random stalls in performance.

Java does not support pointer arithmetic as is supported in, for example, C++. This is because the garbage collector may relocate referenced objects, invalidating such pointers. Another reason that Java forbids this is that type safety and security can no longer be guaranteed if arbitrary manipulation of pointers is allowed.

Syntax

The syntax of Java is largely derived from C++. Unlike C++, which combines the syntax for structured, generic, and object-oriented programming, Java was built exclusively as an object oriented language. As a result, almost everything is an object and all code is written inside a class. The exceptions are the intrinsic data types (ordinal and real numbers, boolean values, and characters), which are not classes for performance reasons.

Hello, world program

This is a minimal Hello world program in Java with syntax highlighting:

// Hello.java
public class Hello {
public static void main(String[] args) {
System.out.println("Hello, World");
}
}

To execute a Java program, the code is saved as a file named Hello.java. It must first be compiled into bytecode using a Java compiler, which produces a file named Hello.class. This class is then launched.

The above example merits a bit of explanation.

  • All executable statements in Java are written inside a class, including stand-alone programs.
  • Source files are by convention named the same as the class they contain, appending the mandatory suffix .java. A class that is declared public is required to follow this convention. (In this case, the class Hello is public, therefore the source must be stored in a file called Hello.java).
  • The compiler will generate a class file for each class defined in the source file. The name of the class file is the name of the class, with .class appended. For class file generation, anonymous classes are treated as if their name was the concatenation of the name of their enclosing class, a $, and an integer.
  • The keyword public denotes that a method can be called from code in other classes, or that a class may be used by classes outside the class hierarchy.
  • The keyword static indicates that the method is a static method, associated with the class rather than object instances.
  • The keyword void indicates that the main method does not return any value to the caller.
  • The method name "main" is not a keyword in the Java language. It is simply the name of the method the Java launcher calls to pass control to the program. Java classes that run in managed environments such as applets and Enterprise Java Beans do not use or need a main() method.
  • The main method must accept an array of String objects. By convention, it is referenced as args although any other legal identifier name can be used. Since Java 5, the main method can also use variable arguments, in the form of public static void main(String... args), allowing the main method to be invoked with an arbitrary number of String arguments. The effect of this alternate declaration is semantically identical (the args parameter is still an array of String objects), but allows an alternate syntax for creating and passing the array.
  • The Java launcher launches Java by loading a given class (specified on the command line) and starting its public static void main(String[]) method. Stand-alone programs must declare this method explicitly. The String[] args parameter is an array of String objects containing any arguments passed to the class. The parameters to main are often passed by means of a command line.
  • The printing facility is part of the Java standard library: The System class defines a public static field called out. The out object is an instance of the PrintStream class and provides the method println(String) for displaying data to the screen while creating a new line (standard out).