Concept of Java.

Ad Code

Concept of Java.

What is Java?

Java is a general purpose, object oriented programming language developed by Sun MicroSystems in 1991. Originally called OAK by James gosling , one of the inventors of the language. But was renamed as java in 1995 and later acquired by Oracle Corporation. It is one of the most popular programming languages used to develop desktop and mobile applications.

Features of Java Programming

  1. Java Platform Independent: Like C compiler, Java compiler does not produce native executable code for a particular machine. Instead, Java produces a unique format called bytecode. It executes according to the rules laid out in the virtual machine specification.
    Bytecode is understandable to any JVM installed on any OS. In short, the java source code can run on all operating systems.
  2. Secured: Security becomes an important issue for a language that is used for programming on internet. Threat of viruses and abuse of resources are everywhere. Java systems not only verify all memory access but also ensure that no viruses are communicated with an applet. The absence of pointers in java ensures that programs can’t gain access to memory locations without proper authorization.
  3. Object-oriented: Java is a true object oriented language. Almost everything in java is an object. All program code and data reside within objects & classes. Object-oriented programming (OOPs) is a methodology that simplifies software development and maintenance by providing some rules.
  4. Robust: Java is a robust language. It provides many safeguards to ensure reliable code. It has strict compile time and runtime checking for data types. It is designed as a garbage collected language relieving the programmers virtually all memory management problems. Java also incorporates the concept of exception handling which captures serious errors and eliminates any risk of crash the system.
  5. Architectural Neutral: One of the problems facing by programmers was program written today will not be run tomorrow even in the same machine or if the OS or if the processor upgrades. So java designers made it architectural neutral by implementing JVM (Java Virtual Machine) through java runtime environment. The main role of java designers to make it architecture neutral write once, run anywhere, anytime forever.
  6. Multithreaded: It means handling multiple tasks simultaneously. Java supports multithreaded programs. This means that we need not wait for the application to finish one task before another.
  7. Dynamic: Java programs carry with them substantial amount of runtime information that is used to access the objects at runtime. This makes java Dynamic.


What is Java Virtual Machine(JVM)?:

JVM (Java Virtual Machine) is an abstract machine. It is a specification that provides runtime environment in which java bytecode can be executed. JVM is a part of Java Run Environment (JRE). In other programming languages, the compiler produces machine code for a particular system. However, Java compiler produces code for a Virtual Machine known as Java Virtual Machine.
How JVM works?
First, Java code is complied into bytecode. This bytecode gets interpreted on different machines between host system and Java source, Bytecode is an intermediary language. JVM is responsible for allocating memory space.



A virtual machine code is not machine specific. The code generated by the java interpreter by acting as an intermediary between the virtual machine and real machine.

JVM Architecture

How to Install Java?

  1. Download Java from the official Java web site: https://www.oracle.com

  2. Go to "System Properties" (Can be found on Control Panel > System and Security > System > Advanced System Settings)

3. Click on the "Environment variables" button under the "Advanced" tab

4. Then, select the "Path" variable in System variables and click on the "Edit" button

5. Click on the "New" button and add the path where Java is installed, followed by \bin. By default, Java is installed in C:\Program Files\Java\jdk-11.0.1 (If nothing else was specified when you installed it). In that case, You will have to add a new path with: C:\Program Files\Java\jdk-11.0.1\bin Then, click "OK", and save the settings



  1. At last, open Command Prompt (cmd.exe) and type java -version to see if Java is running on your machine


How to create and run java programme?

  1. In Java, every application begins with a class name, and that class must match the filename.
    Create Java file which can be done in any text editor (like Notepad).
  2. class Myprg
    {
    public static void main(String args[])
    {
    System.out.println(“Hellow! Welcome to Java World.”);
    }
    }

  3. Save the code in Notepad as Myprg.java(save the file with name same as class name)
  4. Compile programme: Open Command Prompt (cmd.exe), navigate to the directory where you saved your file, and type "javac Myprg.java" This will compile your code. If there are no errors in the code.

4. Now, type "java Myprg" to run the file.






Post a Comment

0 Comments

Ad Code