Saturday, December 6, 2014

ABOUT CORE JAVA

Introduction
Java is an object oriented programming language developed by Sun Microsystems of USA in 1991. Originally name of Java  is Oak Developed by James Gosling.

Java was invented for the development of software for cunsumer electronic devices like TVs, tosters, etc. The main aim had to make java simple, portable and reliable.

Java Authors: James , Arthur Van , and others.

Java Features

Features of Java are as follows:
1. Compiled and Interpreted
2. Platform Independent and portable
3. Object- oriented
4. Robust and secure
5. Distributed
6. Familiar, simple and small
7. Multithreaded and Interactive
8. High performance
9. Dynamic and Extensible

1. Compiled and Interpreted

Basically a computer language is either compiled or interpreted. Java comes together both these approach thus making Java a two-stage system.
Java compiler translates Java code to Bytecode instructions and Java Interpreter generate machine code that can be directly executed by machine that is running the Java program.

2. Platform Independent and portable

Java supports the feature portability. Java programs can be easily moved from one computer system to another and anywhere. Changes and upgrades in operating systems, processors and system resources will not force any alteration in Java programs. This is reason why Java has become a trendy language for programming on Internet which interconnects different kind of systems worldwide. Java certifies portability in two ways.
First way is, Java compiler generates the bytecode and that can be executed on any machine. Second way is, size of primitive data types are machine independent.

3. Object- oriented

Java is truly object-oriented language. In Java, almost everything is an Object. All program code and data exist in objects and classes. Java comes with an extensive set of classes; organize in packages that can be used in program by Inheritance. The object model in Java is trouble-free and easy to enlarge.

4. Robust and secure

Java is a most strong language which provides many securities to make certain reliable code. It is design as garbage –collected language, which helps the programmers virtually from all memory management problems. Java also includes the concept of exception handling, which detain serious errors and reduces all kind of threat of crashing the system.
Security is an important feature of Java and this is the strong reason that programmer use this language for programming on Internet.
The absence of pointers in Java ensures that programs cannot get right of entry to memory location without proper approval.

5. Distributed

Java is called as Distributed language for construct applications on networks which can contribute both data and programs. Java applications can open and access remote objects on Internet easily. That means multiple programmers at multiple remote locations to work together on single task.

6. Simple and small

Java is very small and simple language. Java does not use pointer and header files, goto statements, etc. It eliminates operator overloading and multiple inheritance.

7. Multithreaded and Interactive

Multithreaded means managing multiple tasks simultaneously. Java maintains multithreaded programs. That means we need not wait for the application to complete one task before starting next task. This feature is helpful for graphic applications.

8. High performance

Java performance is very extraordinary for an interpreted language, majorly due to the use of intermediate bytecode. Java architecture is also designed to reduce overheads during runtime. The incorporation of multithreading improves the execution speed of program.

9. Dynamic and Extensible

Java is also dynamic language. Java is capable of dynamically linking in new class, libraries, methods and objects. Java can also establish the type of class through the query building it possible to either dynamically link or abort the program, depending on the reply.
Java program is support functions written in other language such as C and C++, known as native methods.

Difference Between Java and C++

1. Java is true Object-oriented language. C++ is basically C with Object-oriented extension.
2 Java does not support operator overloading. C++ supports operator overloading.
3 It supports labels with loops and statement blocks It supports goto statement.
4 Java does not have template classes as in C++. C++ has template classes.
5 Java compiled into byte code for the Java Virtual Machine. The source code is independent on operating system. Source code can be written to be platform independent and written to take advantage of platform.C++ typically compiled into machine code.
6 Java does not support multiple inheritance of classes but it supports interface. C++ supports multiple inheritance of classes.
7 Runs in a protected virtual machine. Exposes low-level system facilities.
8 Java does not support global variable. Every variable should declare in class. C++ support global variable.
9 Java does not use pointer. C++ uses pointer.
10 It Strictly enforces an object oriented programming paradigm. It Allows both procedural programming and object-oriented programming.
11. There are no header files in Java. We have to use header file in C++.

Java Environment

Java environment includes a number of development tools, classes and methods. The development tools are part of the system known as Java Development Kit (JDK) and the classes and methods are part of the Java Standard Library (JSL), also known as the Application Programming Interface (API).

Java Development kit (JDK) – The JDK comes with a set of tools that are used for developing and running Java program. 

It includes:
1. Appletviewer( It is used for viewing the applet)
2. Javac(It is a Java Compiler)
3. Java(It is a java interpreter)
4. Javap(Java diassembler,which convert byte code into program description)
5. Javah(It is for java C header files)
6. Javadoc(It is for creating HTML document)
7. Jdb(It is Java debugger)

Java Standard Libraries Development (JSL) – The JSL consist a number classes or methods.

It includes:
1.lang - language utilities
2. utill - collection framework
3. io - input/ouput in java
4. applet - internet programming utilities
5. awt - windows heavyweight interface
6. swing - windows lightweight interface

Simple Java Program:

class FirstProgram
{
public static void main(String args[])
{
System.out.println(―This is my first program‖);
}
}

No comments:

Post a Comment