JAVA TUTORIAL

Java Intro Java Features Java vs C++ Java Simple Program Java Applet vs Application JVM,JDK or JRE Java Keywords Java Variables Java Literals Java Separators Java Datatypes Java Operators Java Statements Java Array Java String

CONTROL STATEMENTS

Java If-else Java While Loop Java Do-While Loop Java For Loop Java For-each Loop Java Switch Java Break/Continue

JAVA METHODS

Java Method Java Overloading Java Overriding

JAVA CLASSES

Java OOPs Java Classes/Objects Java Inheritance Java Polymorphism Java Encapsulation Java Abstraction Java Modifiers Java Constructors Java Interface Java static keyword Java this keyword

Features of Java Programming

Java is an object oriented internet programming language

Java has become very popular.

There are many reasons why Java is so popular and some of these reasons are explained here: carefully read all the features of Java and try to realize its strength.

A list of main features of java language is given below:

1. Object Oriented

2. Platform independent

3. Secured

4. Robust

5. Portable

6. Multi-threaded

7. Distributed

8. Easy to Learn

9. Dynamic

10. High Performance


Object Oriented

Java is a true object-oriented language, which provides a platform to develop an effective and efficient application and program real life complexities. Java does not allow methods without class, thus an application consists of only the object which makes it true OOl. Most of the Object-oriented concepts in Java are inherited from C++ which makes it easy for traditional programmers to understand it.

Some features of OOPs are:

1. Object

2. Classification

3. Generalization

4. Inheritance

5. Polymorphism

6. Data Encapsulation

7. Data Abstraction


Platform Independent

Java has a philosophy called WORA (Writing Once, Run Anywhere). Java code is compiled into an intermediate format, called bytecode, which is to be executed in the JVM (Java Virtual Machine). Any system that runs a JVM is able to execute the Java code.

That means we can run java code on multiple plateform, for example, Windows, Linux, Mac/OS, Sun Solaris etc.


Secured

Java is secure because it has managed execution model. In managed execution model of java different security policy are defined for different execution environment.

To implement these security policy, execution of java was made interpreted. So, that security policy can be checked for each instruction before execution


Robust

With automatic garbage collection and simple memory management model (no pointers like C/C++), plus language features like generics, try-with-resources,… Java guides programmer toward reliable programming habits for creating highly reliable applications.

It also provides an exception handling concept to handle logical errors that may crash a system.


Portable

Thats means carry the java byte-codes to any plateform

No implementation dependent features. Everything related to storage is predefined, example: size of primitive data types


Multi-threaded

Java multithreading feature makes it possible to write program that can do many tasks simultaneously.

Benefit of multithreading is that it utilizes same memory and other resources to execute multiple threads at the same time, like While typing, grammatical errors are checked along.


Distributed

Java is also a distributed language. Programs can be designed to run on computer networks.

Java has a special class library for communicating using TCP/IP protocols. Creating network connections is very much easy in Java as compared to C/C++.


Easy to Learn

Java is easy to learn for programmers because it is (syntax) similar to C and C++ and most of the complex parts of C/C++ have been excluded including operator overloading, multiple inheritance and pointers. Approximately half of the bugs in C and C++ programs are related to memory allocation and de-allocation. Therefore the important addition in Java is automatic memory allocation and de-allocation.


Dynamic

Java gives the facility of dynamically linking new class libraries, methods, and objects. It is highly dynamic as it can adapt to its evolving environment.

Java even supports functions written in other languages such as C and C++ to be written in Java programs. These functions are called “native methods”. These methods are dynamically linked at runtime.


high Performance

Java provides high performance with the use of “JIT – Just In Time compiler”, in which the compiler compiles the code on-demand basis, that is, it compiles only that method which is being called. This saves time and makes it more efficient.

Java architecture is also designed in such a way that it reduces overheads during runtime. The inclusion of multithreading enhances the overall execution speed of Java programs.

Bytecodes generated by the Java compiler are highly optimized, so Java Virtual Machine can execute them much faster.