Java – Method

In Java, methods are a group of statements that perform a specific task. In this tutorial, we will learn what is method, how to define the method in Java, and how to use methods with lots of examples. What is a Method Suppose, we need to write some fixed lines of code regularly to perform…

Read More »

Java – Class and Object

In the previous tutorial, we had discussed the OOPs concept in Java. In this chapter, we will learn how to define a class and creating an object in Java. We will also have an example of accessing data members and member functions of a class. Define a Class In Java Let’s start with how to…

Read More »

Java – OOPs Concept

Object-Oriented Programming or OOPs is a modern way of programming to use real-life entities. Java uses features of OOPs, that’s why java is known as an Object-Oriented Programming Language. The core concept of OOP is to bind data and function in a single unit with reuse of the code principal. Features of OOPs. Object Class…

Read More »

Java – String

In this Java String tutorial, we will learn how to create a String, how to accept String input in Java, useful String methods and many more about String with examples. What is a String? In the computer programming world, text values are known as a String. So we can say String is a sequence of…

Read More »

Java – Array

Java array is a collection of multiple data items but of the same data type. In this tutorial, we will learn how to create, store and show data of an array in Java. What is an Array? The array is a data structure. It can store multiple data but of the same type. Elements of…

Read More »

Java – Loops (for, while, do-while)

Java loops are also known as control flow statement and used for iteration (repetition). Loops are used to repeat statements multiple times until the condition is satisfied. In this tutorial, we will learn about the syntax of a loop and how to use a loop in Java program with the example. Types of Loops In…

Read More »

Java – Decision Making

In the programming languages, all the line of the code is an instruction to the computer. The computer follows that instruction and performs the task. But there is a disadvantage of the computer that it can’t take the decision itself. So for the decision making, programming languages use if-else and switch-case statement. Java If Statement…

Read More »

Input in Java – Different Ways

java input

Here we will learn how to accept input in Java. Java has many different ways to accept user input. Here, we will learn many of them with an example. 1. Input Using Scanner The Scanner is a predefined class of java.util package (Library), we need to import before using Scanner class. It has many different…

Read More »