What is String in Java?

In this chapter, we are going to discuss String in java and different ways to create strings in Java. So I guess you have gone through the Classes and Objects in Java.  1. What is String in Java? In Java, String is one of the most widely used Java class. The string is an Object …

Read more

Constructors in Java with Example

In this chapter, we are going to learn about Constructors in Java. Before starting, I recommend reading Class and Package and Super, This, and Final keyword in Java. 1. What is Constructor in Java? Constructors are a piece of code or usually a special method whose name is the same as the class name. Constructors …

Read more

Super vs Final vs This Keyword In Java

In this chapter, we will learn about Super vs Final vs This Keyword In Java. These 3 keywords are very useful while writing Java classes and programs. 1. What is Super in Java? Remember Inheritance? Super keyword in Java plays a major role in Inheritance because we can use the super keyword to call parent …

Read more

Java Naming Conventions – How To Design a Java Class

In this chapter, we are going to look at the basic principles and Java naming conventions that we should follow while writing any Java Class. I guess you have enough idea about What is Class in Java and Object-Oriented Programming. 1. Java Naming Conventions It’s recommended that you should follow Java naming conventions while developing …

Read more

Instance vs Object vs Reference in Java with Example

In order to understand the instance vs object vs reference in Java. First, we need to understand What is Object and Memory Management in Java. 1. What is Object and How it is created? I guess you have enough knowledge of Object-oriented programming and Classes in Java. Therefore, now we are going to look at …

Read more

Variables and Data Types in Java With Example

In this chapter, we are going to learn about variables and data types in Java. Let’s get started. 1. Data Types in Java We always deal with some data while writing a program. Therefore, to write any program or to deal with any kind of data we need to define the type of data we …

Read more

Class and Package in Java with Example

In this chapter, we will learn Class and Package in Java. 1. What is Class in Java? As we discussed in our previous post, Java is an Object-Oriented programming language. Also, everything is considered as an object in Java. For Example, a car is an object. Therefore, it has attributes like colour and weight, behaviour …

Read more

Polymorphism in Java with Example

In this chapter, we are going to look at examples and explanations of Polymorphism in Java. As you all know, polymorphism simply means “different forms”. In Java, it means that we can perform a single action in many different ways. Polymorphism in Java is something related to Inheritance as well. Let’s understand, as you know …

Read more

Encapsulation in Java with Example

In this chapter, we are going to look at examples and explanations of Encapsulation in Java. Before starting encapsulation in Java, you need to understand access modifiers in Java. Access Modifiers in Java: As the name suggested, access modifiers are the keywords which block usage of variable, class, constructor, method or data member. You can …

Read more

Inheritance in Java with Example

In this chapter, we are going to learn examples and explanation of Inheritance in Java. Inheritance is a process where one class can inherit the properties and functionalities of another class. This object-oriented approach is best for code reusability. Hence, we don’t need to redeclare the common methods and variables in every other class. What …

Read more