- HTML Comments Tutorial | Convert Comments into HTML Codes
- Data Structure and Algorithms Tutorial | Ultimate Guide to Learn
- Gradle Tutorial | For Beginners [ STEP-IN ]
- Encapsulation In Java | Complete Tutorial With Examples
- What is Release Management? | A Comprehensive Tutorial for Beginners
- OOPs Concepts in Java | Learn from Basics with Examples
- The Top Basic Tools of Quality Tutorial | The Ultimate Guide
- Set Environment for C# – Learn How to Setup through this Tutorial
- C# Vs Java Tutorial | Overview and Key Difference
- List of IDEs to run C# Programs | Tutorial for Learning Path
- C Sharp Variables and Constants | The Ultimate Guide
- Unsafe Code in C-Sharp Tutorial | Everything You Need to Know
- Type Conversion Method in C# | A Complete Tutorial
- What Is Synchronization in c# Tutorial | The BEST Step-By-Step Guide
- Understanding Structures in C# | Learn in 1 Day FREE Tutorial
- Strings – C# Tutorial | A Definitive Programming Guide
- Static Keyword in C# Tutorial | Learn with Examples
- Stack Collection in C# Tutorial | A Definitive Guide for Beginners
- C# Sorted List Tutorial with Examples | Learn in 1 Day FREE
- C# Serialization Tutorial | Ultimate Guide to Learn [BEST & NEW]
- Regular Expression in C# Tutorial | Everything You Need to Know
- What is Reflection in C#? | Learn Now Tutorial
- Queue Collection in C# Tutorial | A Definitive Guide
- Properties in C# | The complete Tutorial
- C# Preprocessor Directives Tutorial | Learn in 1 Day FREE
- Polymorphism C# Tutorial | The Ultimate Guide
- C# Operators Tutorial | Learn Arithmetic, Comparison, Logical Concepts
- Namespaces – The complete C# Tutorial
- Multithreading in C# Tutorial | Learn With Examples and Advantages
- Methods – C# Tutorial | A Complete Programming Guide
- Linked List Implementation in C# Tutorial | Ultimate Guide to Learn [UPDATED]
- Introduction to C# Tutorial | Guide for Beginners
- What is Interface in C# | A Defined Free Tutorial
- C# Inheritance Tutorial | A Complete Free Tutorial
- Indexers in C# Tutorial | A Complete Programming Guide
- HashSet Collection in C# Tutorial | Complete Guide Tutorial For Free
- Generics in C# Tutorial | Learn Generic Classes and Methods
- Creating Your First C# Program Tutorial | Learn in 1 Day
- Basics of File Handling in C# Tutorial | The Ultimate Guide
- C# Exception Handling Tutorial | Learn with Best Practices
- Events – C# Tutorial | A Complete Programming Guide
- C# Enumerations Type Tutorial | Learn Everything about Enum
- Dictionary Collection in C# | Ultimate Guide to Learn [NEW & UPDATED]
- Delegates – C# Programming Guide | The Ultimate Guide for Beginners
- Understanding Decision Making Statements in C# | Learn Now Tutorial
- Classes and Objects – C# Fundamentals Tutorial
- C# BitArray Collection Tutorial | Learn in 1 Day FREE
- Attributes in C# Tutorial | Learn to work with attributes in C#
- C# Array Tutorial | Create, Declare, Initialize
- ArrayList Collection on in C# | A Complete tutorial For Beginners
- Anonymous Methods and Lambdas – C# Tutorial | A Complete Guide
- Abstraction in C# Tutorial – Learn the Abstract class and Interface
- Game Development using Unity 3D Tutorial | Ultimate Guide to Learn [UPDATED]
- C++ Reference Tutorial | A Comprehensive Guide for Beginners
- PHP vs Python | Which Is Better For Web Development
- C++ Constructors Tutorial: Types and Copy Constructors
- JavaScript Arrays Tutorial | Complete Beginner’s Guide
- What Is Maven | Maven Tutorial For Beginners
- Spring Tutorial | Perfect Guide for Beginners
- React Hooks Tutorial for Beginners | Ultimate Guide to Learn
- Python for Data Science Tutorial | Quickstart : A Complete Guide
- What is Golang? : A tutorial for beginners | Get started
- Hibernate Validator Tutorial | Learn in 1 Day FREE
- Postman Tutorial for Beginners: API Testing using Postman | A Complete Guide
- Akka Tutorial
- J2EE | Web Development Tutorial for Beginners
- Scala Exception Handling Tutorial | Learn in 1 Day [ STEP-IN ]
- Web development Tutorial
- Visual Studio Tutorial
- PyGame Tutorial
- Python Anaconda Tutorial
- Python Scikit-Learn Cheat Sheet Tutorial
- Mean Stack Tutorial
- Python Requests Tutorial
- Advanced Java Tutorial
- Spring Boot Microservices Tutorial
- Java Servlets Tutorial
- How to Install Pycharm
- Pycharm Tutorial
- Python Version Tutorial
- Python strings
- How to Download Python
- C Data Types Tutorial
- arrays in python
- Python While Loop Tutorial
- JAVA Tutorial
- Loops In C Tutorial
- Java File I/O Tutorial
- Variables in Python Tutorial
- Python Tutorial
- Python Pandas Cheat Sheet Tutorial
- Data Structures Cheat Sheet with Python Tutorial
- Python Tuples Tutorial
- Python If Else Statements Tutorial
- Python Functions Tutorial
- HTML Comments Tutorial | Convert Comments into HTML Codes
- Data Structure and Algorithms Tutorial | Ultimate Guide to Learn
- Gradle Tutorial | For Beginners [ STEP-IN ]
- Encapsulation In Java | Complete Tutorial With Examples
- What is Release Management? | A Comprehensive Tutorial for Beginners
- OOPs Concepts in Java | Learn from Basics with Examples
- The Top Basic Tools of Quality Tutorial | The Ultimate Guide
- Set Environment for C# – Learn How to Setup through this Tutorial
- C# Vs Java Tutorial | Overview and Key Difference
- List of IDEs to run C# Programs | Tutorial for Learning Path
- C Sharp Variables and Constants | The Ultimate Guide
- Unsafe Code in C-Sharp Tutorial | Everything You Need to Know
- Type Conversion Method in C# | A Complete Tutorial
- What Is Synchronization in c# Tutorial | The BEST Step-By-Step Guide
- Understanding Structures in C# | Learn in 1 Day FREE Tutorial
- Strings – C# Tutorial | A Definitive Programming Guide
- Static Keyword in C# Tutorial | Learn with Examples
- Stack Collection in C# Tutorial | A Definitive Guide for Beginners
- C# Sorted List Tutorial with Examples | Learn in 1 Day FREE
- C# Serialization Tutorial | Ultimate Guide to Learn [BEST & NEW]
- Regular Expression in C# Tutorial | Everything You Need to Know
- What is Reflection in C#? | Learn Now Tutorial
- Queue Collection in C# Tutorial | A Definitive Guide
- Properties in C# | The complete Tutorial
- C# Preprocessor Directives Tutorial | Learn in 1 Day FREE
- Polymorphism C# Tutorial | The Ultimate Guide
- C# Operators Tutorial | Learn Arithmetic, Comparison, Logical Concepts
- Namespaces – The complete C# Tutorial
- Multithreading in C# Tutorial | Learn With Examples and Advantages
- Methods – C# Tutorial | A Complete Programming Guide
- Linked List Implementation in C# Tutorial | Ultimate Guide to Learn [UPDATED]
- Introduction to C# Tutorial | Guide for Beginners
- What is Interface in C# | A Defined Free Tutorial
- C# Inheritance Tutorial | A Complete Free Tutorial
- Indexers in C# Tutorial | A Complete Programming Guide
- HashSet Collection in C# Tutorial | Complete Guide Tutorial For Free
- Generics in C# Tutorial | Learn Generic Classes and Methods
- Creating Your First C# Program Tutorial | Learn in 1 Day
- Basics of File Handling in C# Tutorial | The Ultimate Guide
- C# Exception Handling Tutorial | Learn with Best Practices
- Events – C# Tutorial | A Complete Programming Guide
- C# Enumerations Type Tutorial | Learn Everything about Enum
- Dictionary Collection in C# | Ultimate Guide to Learn [NEW & UPDATED]
- Delegates – C# Programming Guide | The Ultimate Guide for Beginners
- Understanding Decision Making Statements in C# | Learn Now Tutorial
- Classes and Objects – C# Fundamentals Tutorial
- C# BitArray Collection Tutorial | Learn in 1 Day FREE
- Attributes in C# Tutorial | Learn to work with attributes in C#
- C# Array Tutorial | Create, Declare, Initialize
- ArrayList Collection on in C# | A Complete tutorial For Beginners
- Anonymous Methods and Lambdas – C# Tutorial | A Complete Guide
- Abstraction in C# Tutorial – Learn the Abstract class and Interface
- Game Development using Unity 3D Tutorial | Ultimate Guide to Learn [UPDATED]
- C++ Reference Tutorial | A Comprehensive Guide for Beginners
- PHP vs Python | Which Is Better For Web Development
- C++ Constructors Tutorial: Types and Copy Constructors
- JavaScript Arrays Tutorial | Complete Beginner’s Guide
- What Is Maven | Maven Tutorial For Beginners
- Spring Tutorial | Perfect Guide for Beginners
- React Hooks Tutorial for Beginners | Ultimate Guide to Learn
- Python for Data Science Tutorial | Quickstart : A Complete Guide
- What is Golang? : A tutorial for beginners | Get started
- Hibernate Validator Tutorial | Learn in 1 Day FREE
- Postman Tutorial for Beginners: API Testing using Postman | A Complete Guide
- Akka Tutorial
- J2EE | Web Development Tutorial for Beginners
- Scala Exception Handling Tutorial | Learn in 1 Day [ STEP-IN ]
- Web development Tutorial
- Visual Studio Tutorial
- PyGame Tutorial
- Python Anaconda Tutorial
- Python Scikit-Learn Cheat Sheet Tutorial
- Mean Stack Tutorial
- Python Requests Tutorial
- Advanced Java Tutorial
- Spring Boot Microservices Tutorial
- Java Servlets Tutorial
- How to Install Pycharm
- Pycharm Tutorial
- Python Version Tutorial
- Python strings
- How to Download Python
- C Data Types Tutorial
- arrays in python
- Python While Loop Tutorial
- JAVA Tutorial
- Loops In C Tutorial
- Java File I/O Tutorial
- Variables in Python Tutorial
- Python Tutorial
- Python Pandas Cheat Sheet Tutorial
- Data Structures Cheat Sheet with Python Tutorial
- Python Tuples Tutorial
- Python If Else Statements Tutorial
- Python Functions Tutorial
JAVA Tutorial
Last updated on 08th Oct 2020, Blog, Software Engineering, Tutorials
Java is a popular programming language developed by Sun Microsystems (later merged with Oracle) in 1991. Java was developed by James Gosling and Patrick Naughton.
In our day to day life from morning to evening, we are using many Java programmed applications and devices which include the smartphone in your hand to secure ATM backing transactions.
An explicit sequence of Java tutorials is compiled in this series to give you a better understanding of the concept of Java.
Initially, it was named as “Oak” but was renamed subsequently in 1995 as “Java” since Oak was already a registered trademark.
The first edition of Java was known as “Java 1.0”. Over the years, Java language has evolved considerably and lots of features have been added to Java. As a result, lots of new versions have been released. The latest edition of Java is JDK (Java Development Kit) 13 or Java 13, which was released on September 10, 2019.
So, what is Java?
In simple terms, Java is an object-oriented programming language that derives both from C and C++. From C, Java takes its format while it takes the object-oriented programming from C++. So in order to learn Java from scratch, an individual with C/C++ knowledge would find it easy to grasp.
So, we can define Java as a
- Simple
- Highly robust
- Object-oriented
- Secure programming language.
Any hardware component or a software environment in which a program runs is called a “platform”. Java has a Java Runtime Environment (JRE) running on it. Thus Java is also a platform.
We will learn more about Java as a platform in our subsequent tutorials.
As of today, Java programming language is the most popular programming language for developing client-server web applications for the internet with an estimated 9 million developers working on and using Java.
Subscribe For Free Demo
Error: Contact form not found.
Java Features
Let’s discuss some of the distinguishing features of the Java programming language.
- Simple: Java syntax is quite simple and easy to understand. Java is also easy to learn. Most of the features of C++ that were either difficult to understand or ambiguous are simplified in Java and some are omitted. For Example, pointers are absent in Java.
- Secure: A Java program runs in Java Runtime Environment (JRE) that makes it secure. The JRE does not have interaction with system OS, so java programs do not interfere with the system. Additionally, the Java language has security features that allow us to develop virus-free, secure applications. This is why many banking applications are built on Java.
- Robust: Java introduces automatic garbage collection and exception handling that helps to prevent any potential errors. Java also emphasizes on compile time and run time error checking. All these features make programs/applications developed in Java more robust.
- Portable: The Java program compiled into Byte code can be run on any platform. It is implementation-independent and everything required to run the code like storage, data types, etc. are predefined.
- Object-oriented: Java is a pure object-oriented programming language. Everything in Java is an object. The language features are easily extendible as there is a solid object-based model for programming. Java language supports all the major features of Object-oriented programming.
- Platform independent: Java is a “write once, run anywhere” code. Unlike other programming languages that compile into machine-specific code, Java is compiled into a byte code that can run on any machine independent of the operating system. Any machine that runs Java Runtime Environment (JRE) can run this byte code.
- Multithreaded: Java’s multithreading feature allows Java applications to perform multiple tasks simultaneously. Moreover, multiple threads utilize the same memory and other resources and carry out tasks simultaneously.
- Distributed: Using Java we can develop distributed applications using advanced Java concepts like Remote Method Invocation (RMI) and Enterprise Java Beans (EJB).
So we can distribute the Java program on various machines connected through the internet i.e. an object on one machine can execute remote procedures on another remote machine.
These are the major features of Java that make it a popular and most sought after programming language today.
Let’s discuss the various application types that we can develop using Java programming language.
Java Application Types
Java programming language can be used to create the following types of applications.
1) Standalone Applications
These are also known as Windows-based or desktop applications. These are basically independent software that can install on the desktop.
Applications like media player, antivirus software, desktop editors, etc. are some of the applications that are standalone. Java features like AWT and Swing are typically used to develop these types of applications.
2) Enterprise Applications
Enterprise applications are usually distributed applications and have features like high security, load balancing, and clustering.
Java provides these features through enterprise Java Beans (EJB) and as such EJB can be used to develop enterprise applications. Banking applications are enterprise applications that are most popular.
3) Web Applications
Web applications run on the server-side and create dynamic web pages. These applications need to be highly dynamic and should be able to develop web pages on the go. Java features like JSP, servlets, struts, spring, hibernate, etc. are used for developing web applications.
4) Mobile Applications
A mobile application is an application developed to run on mobile. Currently, Java ME and Android are used for developing mobile applications.
From this, we see that Java allows us to develop a range of applications using its various features. This makes Java the most popular language that is still on top even after so many years since its development. As a programmer, we need not switch technologies to develop different kinds of applications. We can do almost everything using Java.
Java Versions
| VERSIONS | RELEASE YEAR |
|---|---|
| JDK 1.0 | 1996 |
| JDK 1.1 | 1997 |
| J2SE 1.2 | 1998 |
| J2SE 1.3 | 2000 |
| J2SE 1.4 | 2002 |
| J2SE 5.0 | 2004 |
| Java SE 6 | 2006 |
| Java SE 7 | 2011 |
| Java SE 8 | 2014 |
| Java SE 9 | 2017 |
Overview of Java Programming
- Java program can be written in any plain text file and can be named as myprogram.java
- This code will be compiled by the JDK (Java Development Kit) and this “.java” file will be converted into bytecode as “myprogram.class” file.
- Again, that will be converted into 0’s and 1’s by JVM (Java Virtual Machine). It can be run on any platform as JVM is available for several operating systems.
- So, to create a Java project, you need JDK installed on your machine. If you download JDK, it will contain JRE (Java Runtime Environment) and development tools.
- JRE is the Java Runtime environment that is required to run the Java application and it consists of JVM, package classes and runtime libraries.
- Click here to download JDK.
Java Program Compilation And Execution Flow

Java Integrated Development Environment (IDE)
Java IDE is a software that helps the users to write and debug the program easily. It can highlight syntax and errors. One of the famous IDE is Eclipse. Download Eclipse from this link.
Key points to be noted:
- Java is platform-independent as Java program can be run in any OS or any hardware.
- To compile the Java program we need JDK.
- JRE provides a runtime environment.
- Many amazing applications have been developed by the Java platform. For Example, NASA World Wind has been fully developed in Java. It is similar to google earth. And Blu-Ray BD J has been developed in Java.
- Eclipse is a popular and open-source IDE to develop Java projects.
Install Java
Step 1: Verify that it is already installed or not
Check whether Java is already installed on the system or not. In my case, it is not installed therefore I need to install JDK 1.8 on my computer.
Step 2: Download JDK
- Click the below link to download jdk 1.8 for you windows 64 bit system.
- Download JDK For Windows
- There are available releases for Linux and mac operating systems. You can visit the official link for JDK distributions i.e.
- JDK Downloads
Step 3: Install JDK
- Open the executable file which you have just downloaded and follow the steps.
- Click Next to continue
- Just Choose Development Tools and click Next.
- Set up is being ready.
- Choose the Destination folder in which you want to install JDK. Click Next to continue with the installation.
- Set up is installing Java to the computer.
- We have successfully installed Java SE development kit 8. Close the installation set up.
Step 4 : Set the Permanent Path
To execute Java applications from command line, we need to set Java Path. To set the path, follow the following steps.
- Right click on “this PC”. It can be named as “My Computer” in some systems. Choose “properties” from the options.
- The screen look alike the above image will open. Click on “Advanced system settings” to continue.
- Above window will open. Click on “Environment Variables” to continue.
- Enter “path” in variable name and enter the path to the bin folder inside your JDK in the variable value. Click OK.
- Now Java Path has been set up. Open the Command prompt and type “javac” In case you have already open up the command prompt, I suggest you to close the existing window and reopen it again.
- We will get javac executed as shown in the image below.
- The Java has been installed on our system. Now, we need to configure IDEs like NetBeans or Eclipse in order to execute JavaFX applications.
Java Program Examples
Let try Java program example. This simple example compiled using jGRASP.
Suppose that
- You get a monthly pay (before tax) with an amount of monthlyPay
- Your tax rate is taxRate
- Your expense a year has an amount of expense
Write a Java program to:
- calculate your annualPayAfterTax
- calculate your netIncome
- print out your monthlyPay in the first line
- print out your taxRate in the second line
- print out your annualPayAfterTax in the third line
- print out you expense in the fourth line.
- print out your netIncome in the fifth line.
A Sample output will look something like this:
- My monthly pay is $2555
- My tax rate is 0.33
- My annual pay after tax is $20542.2
- My expense a year is $5000
- My net income a year is $15542.2
Remark:
- taxRate is not an integer! You should declare its type as double.
- annualPayAfterTax = monthlyPay * (1-taxRate)*12.
- netIncome = annualPayAfterTax – expense.
- Since taxRate is not integer, annualPayafterTax and netIncome are also have to be declared as double; otherwise, you will get error message from compiler.
Answer:
- import java.util.Scanner;
- * @author Mikerisan
- public class MyIncome
- // Calculates and prints my yearly income and related items
- public static void main(String[] args)
- final double taxRate = 0.33;
- double monthlyPay, expense, annualPayBeforeTax, annualPayAfterTax, netIncome;
- Scanner readmonthlypay = new Scanner(System.in);
- // prompt user for input
- System.out.println(“Enter your monthly pay: “);
- // read and store input
- monthlyPay = readmonthlypay.nextDouble();
- Scanner myexpense = new Scanner(System.in);
- // prompt user for input
- System.out.println(“Enter your yearly estimate expenses: “);
- // read and store input
- expense = myexpense.nextDouble();
- // prints monthly pay
- System.out.println(“My monthly pay is USD” + monthlyPay);
- // prints tax rate
- System.out.println(“My tax rate is ” + taxRate);
- // calculate yearly income
- annualPayBeforeTax = (monthlyPay * 12);
- // prints annual pay before tax
- System.out.println(“My annual pay before tax is USD” + annualPayBeforeTax);
- // calculate yearly income after tax
- annualPayAfterTax = annualPayBeforeTax *(1-taxRate);
- // prints annual pay after tax
- System.out.println(“My annual pay after tax is USD” + annualPayAfterTax);
- // prints yearly expense
- System.out.println(“My expense a year is USD” + expense);
- // calculate yearly net income
- netIncome = annualPayAfterTax – expense;
- // prints yearly net income
- System.out.println(“My net income a year is USD” + netIncome);
A Sample Output:
Enter your monthly pay: 6000The following Figures show the steps using Java command line. Firstly we compile the source code that will generate a bytecode. Make sure there is no error.
Conclusion
This tutorial outlined the very basic information on Java language from its history of development to its various features and types of applications that we can develop using this language.
Java language is easy to learn and has a very simple syntax. Any novice programmer can learn the java basics but the learning becomes easier if a programmer has prior knowledge of C and C++ languages. This is because Java derives its format from C and takes its OOP features from C++.
