About the java Technology
java technology is both a programming language and a platform.
The Java Programming Language
the java programming language is a high-level language that can be characterized by all of the following buzzword.
- Simple
- Object oriented
- Distributed
- Multithreaded
- Dynamic
- portable
- High performance
- Robust
- Secure
In the java programming language,all source code is first written in plain text files ending with the .java extension.Those source files are then compiled into .class by the java compiler.
a .class file does not contain code that is native to your processor.it's contain the bytecode - the machine language of the java virtual Machine (java VM). Because the java virtual machine is available on many different operating system,the same .class files are capable of running on microsoft Windows,Linux or MAC.
java Program
class hello
{
public static void main(string args[])
{
System.out.println("hello World ");
}
}
A plateform is the h/w and s/w environment in which a program runs.
The java plateform has two components:
- The java virtual Machine
- the java Application Programming Interface(API)
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.
Java Program Execution
The Java byte-code compiler translates a Java source file into machineindependent
byte code. The byte code for each publicly visible class is placed in a
separate file, so that the Java runtime system can easily find it. If your program
instantiates an object of class A, for example, the class loader searches the
directories listed in your CLASSPATH environment variable for a file called A.class
that contains the class definition and byte code for class A.
There is no link phase for Java programs.all linking is done dynamically runtime.
hii user
ReplyDeletelovely publisher
ReplyDeletenice
ReplyDelete