Contributor: Dipal Modi
- Java was convinced / developed by James Gosling and Sun Microsystem. In 1991, Sun Microsystem took 18 months for the first version and announced in 1993. Initial name of Java was “OAK”. But, it is renamed to Java in 1995.
- The primary motivation of Java was the need for the platform independent language i.e. “Write Once, Run Anywhere.”
- Java enables to build platform independent program, then execute in wide verity of hardware and software environment.
- Java has dynamic webpage, who include reference to small Java program known as “Applet.”
Programs are of two types:
- A program which runs on standalone machine is called “Application”.
- Application are of two types:
- Console Application:
- An application which runs on DOS and can generate CUI (Character User Interface) is called “Console Application”.
- C, C++ can generate Console Application.
- Window Application:
- A program which can run on windows and can generate graphical component like button, checkbox, radio button, text field, label, etc.
- GUI (Graphical User Interface) is called Windows Application.
- VB, FoxPro can have Window Application.
- Applet is a tiny program which can run on internet. Applet is a program which can be embedded on a webpage, if a webpage contains static information i.e. Read only data, then such webpages are called Static Webpage.
- Java can generate static as well as dynamic webpage, dynamic webpage is a special program which can be executed even after a page has been displayed on web browser.
- Using Applet, a client request a server for specific result.
- Java can generate Console Application, Window Application and Applet as well.
- Console Application:
What is Byte Code?
- Byte code is a highly optimize set of instruction design to be interpreted by JVM (Java Virtual Machine).
- This is completely independent code and Java can generate and execute it on any machine under any OS (operating System).
- Translating a Java program into byte code makes it easier to run a program in wide variety of environment reason is that only JVM needs to implement for each platform.
Rules to Write a JAVA Program
- Main method must be in a specific class.
- Name of class having main must match with Program name.
- Class having main should be public.
- Import necessary packages.