Java instanceof Operator

In this tutorial, you will learn about Java instanceof operator in detail with the help of examples. The instanceof operator in Java is used to check whether an object is an instance of a particular class or not. Its syntax is Here, if objectName is an instance of className, the operator returns true. Otherwise, it returns false. Example: Java instanceof Output In… Continue reading Java instanceof Operator

Java Recursion

In this tutorial, you will learn about Java recursive function, its advantages and disadvantages. In Java, a method that calls itself is known as a recursive method. And, this process is known as recursion. A physical world example would be to place two parallel mirrors facing each other. Any object in between them would be reflected recursively.… Continue reading Java Recursion

Java final keyword

In this tutorial, we will learn about Java final variables, methods and classes with examples. In Java, the final keyword is used to denote constants. It can be used with variables, methods, and classes. Once any entity (variable, method or class) is declared final, it can be assigned only once. That is, the final variable cannot be reinitialized… Continue reading Java final keyword

Java this Keyword

In this article, we will learn about this keyword in Java, how and where to use them with the help of examples. this Keyword In Java, this keyword is used to refer to the current object inside a method or a constructor. For example, Output: In the above example, we created an object named obj of the… Continue reading Java this Keyword

Java Access Modifiers

In this tutorial, we will learn about the Java Access Modifier, its types, and how to use them with the help of examples. What are Access Modifiers? In Java, access modifiers are used to set the accessibility (visibility) of classes, interfaces, variables, methods, constructors, data members, and the setter methods. For example, In the above… Continue reading Java Access Modifiers

Java Strings

In this tutorial, we will learn about Java strings, how to create them, and various methods of the String class with the help of examples. In Java, a string is a sequence of characters. For example, “hello” is a string containing a sequence of characters ‘h’, ‘e’, ‘l’, ‘l’, and ‘o’. We use double quotes to represent a string in Java. For example, Here,… Continue reading Java Strings

Java Constructors

In this tutorial, we will learn about Java constructors, their types, and how to use them with the help of examples. What is a Constructor? A constructor in Java is similar to a method that is invoked when an object of the class is created. Unlike Java methods, a constructor has the same name as that… Continue reading Java Constructors

Method Overloading

In this article, you’ll learn about method overloading and how you can achieve it in Java with the help of examples. In Java, two or more methods may have the same name if they differ in parameters (different number of parameters, different types of parameters, or both). These methods are called overloaded methods and this feature is… Continue reading Method Overloading

Java Methods

In this tutorial, we will learn about Java methods, how to define methods, and how to use methods in Java programs with the help of examples. Java Methods A method is a block of code that performs a specific task. Suppose you need to create a program to create a circle and color it. You… Continue reading Java Methods

Class and Objects

In this tutorial, you will learn about the concept of classes and objects in Java with the help of examples. Java is an object-oriented programming language. The core concept of the object-oriented approach is to break complex problems into smaller objects. An object is any entity that has a state and behavior. For example, a bicycle is an object. It… Continue reading Class and Objects