Constructor in java is block of code which allows you to create instance of the object. It does not have return type.It has two main points Constructor name should be same as class Constructor should not have any return type else it will be same as method. There are three types ofContinue Reading

this keyword in java is used to refer to current object or instance of class. It can be used in the constructor to call any other overloaded constructor but this keyword should be the first statement in the constructor. This keyword can be used for instance variables this keyword can be used toContinue Reading

super Keyword in java is used to refer the object of the immediate superclass, and it is related to inheritance in java. Let’s say you have an instance variable or method of same name in subclass and superclass. How will JVM know which one are you referring to; superclass or subclass?That’s where you can use super keyword to refer superclass’s variables, methodsContinue Reading

The access modifiers in java define accessibility (scope) of variable, method, constructor or class. There are 4 types of access modifiers in java. Public access modifier Private access modifier Default access modifier Protected access modifier You don’t have to explicitly put the default modifier.JVM will use default modifier if you doContinue Reading

Introduction The word Inheritance is quite familiar with everyone. In common terms, the word means the bequeathing of property and characteristics from generation to generation. For example, the property or characteristics of parents are handed down to their children and the forthcoming generations. Object Oriented Programming (commonly OOP) concepts are based on realContinue Reading

A method is a collection of statements that perform some specific task and return the result to the caller. A method can perform some specific task without returning anything. Methods allow us to reuse the code without retyping the code. In Java, every method must be part of some class which isContinue Reading

Classes and objects are the basic concepts of object-oriented programming. It revolves around the real world entity. In Java, the object is a physical and logical entity, whereas classes are logical entity only. Objects in Java- Objects are real-world entities that have state and behavior. Objects can be physical andContinue Reading

Since the dawn of earth, we have kept on evolving. The need for evaluation comes with the aim of improving the existing systems when something inappropriate is found for the environment. Same is true in the case of programming languages. We need development in programming languages as well. Before discussingContinue Reading

for loop A for loop is used to execute a set of statements for a fixed number of times. It takes the following form: for (initialization; condition; update) { statements; } The for loop defines three types of statements separated with semicolons ( ; ), as follows: Initialization statements TerminationContinue Reading

Structure of Switch Statement // variable_to_test: A varible to test. switch ( variable_to_test ) { case value1: // Do something here … break; case value2: // Do something here … break; default: // Do something here … } The characteristics of switch statement: The switch will check the value of a variableContinue Reading