Java Programming Language Tutorial

Java Programming language

Java Programming Tutorial

Java is a widely used general purpose versatile programming language known for its platform independence and strong emphasis on portability. Java has a significant presence in diverse fields, including web development, mobile applications, and enterprise systems.

Our easy to understand Java programming tutorial will lead you through the process of learning Java programming one step at a time.

Java is a high-level object-oriented programming language originally developed by James Gosling at Sun Microsystems and released in 1995. Java programming language is easy to learn and it's syntax is similar to C++ programming language. Java is one of the most popular programming language.

Java programs are platform independent, once you write a java program it will run on a variety of platforms like Windows, Mac OS, and the various flavors of UNIX.

Java is one of the most popular programming language. Most major IT companies use Java based technology in one way or other. Java is fast, scalable, secure and platform independent due to which many enterprise server side applications are written in Java to process millions of requests per day. According to Sun Microsystems, 3 Billion devices uses Java.

Uses of Java

There are many places where Java is used in real world.

  • Desktop Applications like text editors, mp3 player, IDE's like eclipse etc.

  • Scientific Applications like simulation software, weather forecasting etc.

  • Web Applications, like eCommerce websites, news portals, trading systems etc.

  • Enterprise Applications like internet banking, payment gateways etc.

  • Mobile Apps. Most of the android apps are written in java.

  • Embedded System like thermal sensors, blue ray disc players.

  • Web servers and Application servers.

  • Medical equipments.

  • Defence technology.

Advantages of Java

  • Java is platform independent programming language. Hence, java program written in one platform can run in multiple platforms like desktop, embedded systems and mobile without any modifications. Java is guaranteed to be Write Once, Run Anywhere.

  • Java is simple, easy to learn, free, object-oriented, supports distributed programming and multi-threading, and offers network and multimedia support.

  • Java is highly popular among the tech community. Easy availability of documentations and support via various popular community support websites like

  • Java is a wisely accepted, stable and time tested programming language. Over the time we have created lots of Java Class Library and frameworks which provides cross-platform development.

  • Java programs are not just limited to desktop applications. You can develop a java program for any platform of any configuration if it has JVM installed.

  • Frequent releases of new versions of java with new features with backward compatibility.

  • Java has powerful development tools like Eclipse SDK, NetBeans, JDeveloper, IntelliJ IDEA.

Design Principles behind the development of Java language

  • Java must be "simple, object-oriented, and familiar".

  • Java must be "interpreted, threaded, and dynamic".

  • Java must be "architecture-neutral and portable".

  • Java must execute with "high performance".

  • Java must be "robust and secure".

Types of Java Programs

  • Mobile Application
    Java is used to create applications specific for mobile devices. Applications created in one mobile can run on all mobile devices having JVM. Java ME is used for creating mobile applications. Most of the android apps are created using java.

  • Web Application
    A web application is a program which runs on a remote server and delivers custom content to a client using web browser. Like ecommerce websites, social media websites etc. Java technologies like JSP, JBOS, Struts are used for creating web applications.

  • Standalone Application
    It is also known as desktop application, which is stored and executed locally in computer. Such application needs to be installed on every computer like text editors, mp3 players, Image editing software etc. Currently, Swing and AWT are used for creating standalone desktop applications.

  • Enterprise Application
    An enterprise application is generally distributed in nature, secure, scalable, mission-critical and designed to operate in a corporate environment such as business or government. For Banking applications, share trading applications etc. EJB is used for creating enterprise applications.

Features of Java

  • Simple
    Java is a simple and easy to learn programming language. The syntax of java is similar to C++, hence it becomes to learn java for those who is already familiar with C and C++. Java provides lots of programmer friendly libraries and features like automatic garbage collections and collections framework.

  • Platform Independent
    Java programs are platform independent, unlike C and C++ programs. It means a program written in one hardware/software platform can run on other platforms also without any need of platform specific changes. For example, a program compiled in windows can also sun in UNIX, Solaris etc. Unlike C and C++, when a java program is compiled by the compiler it gets converted into platform independent bytecode. This bytecode can be interpreted by JVM of different platforms.

  • Object-Oriented
    Java is a fully object oriented programming language unlike C++ which is object oriented extension of C. Every think is java is modeled as an Object. A java application contains of various objects interacting with each other. It supports popular object oriented programming concepts like encapsulation, inheritance, abstraction and polymorphism.

  • Architecture Neutral
    Java compiler generates a generic and architecture neutral bytecode which is tied to any specific computer architecture. Whether it is 32 bit or 64 bit computer, same bytecode can can executed their respective java run-time environments.

  • Secured
    Java provides various security features(which is a critical requirement for enterprise applications) like authentication techniques, encrypted data transfer, no pointer etc which makes a java application more secure difficult to hack. Unlike C and C++ programs which directly interacts with OS their is an extra layer of JVM between java application and operating system.

  • Portable
    As java programs are platform independent and free of any architecture specific implementation, it can be executed in any platform having JVM.

  • Interpreted
    Unlike C and C++ compilers which directly generates system executable(.exe) machine instructions, java source files are compiled into .class bytecode by java compiler. Java byte code is then interpreted by JVM to create native machine instructions.

  • Robust
    Java programs are strong and they don’t crash easily. Java has got excellent inbuilt exception handling and automatic memory management features. Unlike C and C++, lack of pointers in java make it more secure. Java tries to find error prone code bu performing compile time and run-time error checking.

  • Dynamic
    Java programs are very agile and support dynamic loading. A java program can take lots of decisions on run-time and change its behavior accordingly.

  • High Performance
    In comparison with C and C++, Java programs are little bit slower due to interpretation of bytecode by JVM. With the introduction of Just In Time compiler, java ensures high performance.

  • Distributed
    RMI and EJB of Java is used for creating distributed web applications.

  • Multi-threaded
    Using multi threading in java, we can write a java program which can perform multiple tasks at the same time. Java provides libraries to manage threads and thread pools. Using multiple threads can significantly improve the performance of java program.