Dremendo Tag Line

Learn to Code in Java Programming

Java Basic Concepts
java programming tutorial

In this lesson, we will learn about the Java programming language in a step by step process. From the history of Java to its applications, and the key features of this language. We will also learn about the difference between Java and C++.

Java Introduction

Java is a simple, secure, portable, robust, object-oriented, multithreaded, architecture-neutral, interpreted, high-performance, distributed and dynamic programming language. Java is also known as write-once, run-anywhere programming language.

  • Simple - It means Java language is very easy to learn.
  • Secure - It means that Java has advanced authentication and access control functionalities which makes the web application secure.
  • Portable - It means that Java code can execute on all major platforms. You have to compile your Java source code file into a bytecode file. After that, you can use that bytecode file in any platform which supports Java JDK. That is without any modification. Other programming languages first need to compile their codes into a "machine code" for each platform it wants to operate.
  • Robust - It means that Java has better memory management and exception handling features which can handle the errors during execution and manage the incorrect input of data.
  • Object-Oriented - It is model of programming which aims to work with the real-world entities in programming. Such as inheritance, data hiding, polymorphism etc. The main aim of OOP (Object Oriented Programming) is to bind a specific portion of data and functions together so that no other part, of rest of the code, can access them.
  • Multithreading - Java supports multithreaded programming. Due to this, multithreaded programs written in Java can perform several tasks at the same time.
  • Architecture-Neutral - It means that when you compile a Java code it produces a bytecode which can run on many platforms with the help of Java Runtime Environment (JRE) and Java Virtual Machine (JVM).
  • Interpreted - Java is a cross-platform program because it creates an intermediate representation named Java bytecode. And for this, Java can run on any platform with the help of JDK.
  • High-Performance - It means that Java uses the Just In Time (JIT) compiler to enable high performance. JIT is used to change the instructions in bytecodes.
  • Distributed - By using Java, one can create distributed applications that can access files by calling the programs from any machine on the internet using RMI and EJB.
  • Dynamic - Java can compile and load its class dynamically on demand. It can compile and load a specifically required portion of code instantly rather than compiling the whole code.

Who developed Java programming language?

Java was developed by Canadian computer scientist James Arthur Gosling, at Sun Microsystems. In the year 1995, it released as a core element of Sun Microsystems' Java platform.

Applications of Java

Java language is used in the following areas given below:

  • Desktop GUI Applications
  • Mobile Applications
  • Embedded Systems
  • Web Applications
  • Web Servers and Application Servers
  • Enterprise Applications
  • Scientific Applications
  • Gaming Applications
  • Distributed Applications
  • Big Data technologies
  • Cloud-based Applications

Difference between C++ and Java

Below is the table of major differences between C++ and Java:

C++ Java
C++ programs are platform dependent. They need to be compiled for a particular platform. Java programs are platform independent. Java programs are written for Java Virtual Machine (JVM). It will run without needing recompilation.
C++ only support compiler. Java supports both compiler and interpreter
C++ supports inheritance including multiple inheritances. Java supports inheritance except for multiple inheritance.
C++ supports destructors. Java does not support destructor.
C++ does not supports garbage collection. Java supports garbage collection.
C++ supports pointers, unions and structure. Java does not support pointers, unions and structure.
Write once compile anywhere. Write once run anywhere everywhere.
Allows both procedural programming and object-oriented programming. Support object-oriented programming model.
C++ supports both method overloading and operator overloading. Java only supports method overloading. It does not provide support for operator overloading.
In C++, It is Programmer responsibility to check the errors. It is system responsibility to check error in the program.

Is learning Java difficult?

The answer is NO. Java language is not difficult to learn at all. And once you master Java language, you can write so many application software.

Test Your Knowledge

You Scored :

Percentage :