ARTICLESCLOUD.COM
FOR FREE LEARNING SESSIONS - HOW LAPTOPS WORK - FEEDBACK
 

Java Programming

JAVA AS A PROGRAMMING LANGUAGE

The Java programming language is a high-level, object oriented language. It is a third generation programming language like C. You can use Java to write computer applications that execute calculations, generate numbers, process words, play games, store data etc. Compared to other programming languages, Java is most similar to C. Java in relation to other programming languages lets you write special programs called applets that can be downloaded from the Internet and played safely within a web browser. A Java applet cannot write to your hard disk without your permission.

JAVA AS A PLATFORM

A platform is the hardware or software environment in which a program runs. Most platforms can be described as a combination of the operating system and underlying hardware. The Java platform differs from most other platforms. Java is a software-only platform that runs on top of other hardware-based platforms. The Java platform has two components: The Java Virtual Machine : A JVM is a piece of software that is responsible for running Java programs. The JVM is an abstract computing machine and (just like a real computing machine) has a defined instruction set. The JVM knows nothing of the Java language, only of a particular file format, the class file format. A class file contains JVM instructions (or bytecodes) and a symbol table, as well as other required information. It interprets the bytecodes that are written by the Java compiler appropriate for the platform. The Java Application Programming Interface (API) : The API is a large collection of ready-made software components that provide many useful capabilities. The Java API is a rich set of predefined classes that you can reuse in your programs.

ADVANTAGES OF JAVA

1) JAVA IS SIMPLE : Java was designed to make it much easier to write bug free code.Because Java is simple, it is easy to read and write. The language is small so it's easy to become fluent. The runtime environment provides automatic memory allocation and garbage collection so there is less chance for the programmer to think about. 2) JAVA IS OBJECT ORIENTED : Object oriented programming is simpler and easier to read programs. It is more robust and error free. 3) JAVA IS PLATFORM INDEPENDENT : Java applications consist of byte-code which may be interpreted by a virtual engine. Thus, the applications are able to run on any hardware for which a virtual engine exists. 4) JAVA IS SAFE : There are no pointers in JAVA. Java programs cannot access arbitrary addresses in memory. Java implements a robust exception handling mechanism to deal with both expected and unexpected errors. The worst that an applet can do to a host system is bring down the runtime environment. It cannot bring down the entire system. Java, by making it easier to write bug-free code, substantially improves the security of all kinds of programs. 5) JAVA IS HIGH PERFORMANCE Java byte codes can be compiled in speed using a "just-in-time compiler". It is certainly possible to write large programs in Java. 6) JAVA IS MULTI THREADED : Java is inherently multi-threaded. A single Java program can have many different threads executing independently and continuously. This makes Java very responsive to user input. It also helps to contribute to Java's robustness. 7) JAVA IS DYNAMIC Java does not have an explicit link phase. Java source code is divided into .java files, roughly one per each class in your program. The compiler compiles these into .class files containing byte code. Each .java file generally produces exactly one .class file. More importantly, classes that were unknown to a program when it was compiled can still be loaded into it at runtime. Furthermore, Java .class files tend to be quite small, a few kilobytes at most. It is not necessary to link in large runtime libraries to produce an executable. Instead the necessary classes are loaded from the user's CLASSPATH. 8) JAVA IS GARBAGE COLLECTED: You do not need to explicitly allocate or de-allocate memory in Java. Memory is allocated as needed and reclaimed by the garbage collector when it is no longer needed. There are constructors and these do allocate memory on the heap, but this is transparent to the programmer.