Java Program Structure

Java Program Structure
A file containing Java source code is considered a compilation unit. Such a
compilation unit contains a set of classes and, optionally, a package definition to
group related classes together. Classes contain data and method members that
specify the state and behavior of the objects in your program.

Java programs come in two flavors:

• Standalone applications that have no initial context such as a pre-existing main
window

• Applets for WWW programming

The major differences between applications and applets are:

• Applets are not allowed to use file I/O and sockets (other than to the host
platform). Applications do not have these restrictions.

• An applet must be a subclass of the Java Applet class. Aplications do not need to
subclass any particular class.

• Unlike applets, applications can have menus.

• Unlike applications, applets need to respond to predefined lifecycle messages
from the WWW browser in which they're running.

  © Free Blogger Templates Modic Template by For more Information : click Here

Back to TOP