Sunday, 27 January 2013

What is Java?

Java is a technology which consists of Java Programming Language, Java Development Environment, Java Application Environment and Java Deployment Environment.  Java Programming Language is platform independent. It means that it can run on any platform (any operating system, any hardware) and can be used to develop any type of application like web applications, server applications and desktop applications. The syntax of Java Programming Language is similar to that of C++ programming language.

Code for simple program in C++
#include <iostream>
using namespace std;
int main() {
std::cout << “Welcome to the wonderful world of C++!!!\n”;
return 0;
Code for simple program in Java
class Apple
public static void main(String []a)
System.out.println(“Welcome to the wonderful world of java programming”);
As illustrated above, both the programs in C++ and Java have a main function which is the entry point. C++ uses cout function for printing a statement while Java uses println function for printing a statement.  The rest of the syntax of the Java code will be explained in further posts.
Main Objectives of Java Technology
- Enables users to develop the code easily.
- Java code can be developed and run on any platform that is a certified Java Virtual Machine.
- Increases development speed
- Ability to run more than one block of code at the same time.
- JVM provides high level of security.
The java technology architecture has the following components for achieving its objectives –
- The JVM
- Garbage collection
- The JRE
- JVM tool interface
The java virtual machine Java virtual machine is an imaginary machine that is executed by emulating it in a software or real machine. Code for the JVM resides in .class file that contain code for at most one public class.

No comments:

Post a Comment