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

if statement The if statement is the most basic of all the control flow statements. It tells your program to execute a certain section of code only if a particular test evaluates to true.Below is the structure of if statement: if (condition)  {     // Do something here if ‘condition’ is true. } The above imageContinue Reading

What is a Variable? The variable is the basic unit of storage in a program. We define a variable using an identifier, a type, and an optional initializer in Java. In Java, variables must be declared before they can be used. Java allows variables to be initialized dynamically, using anyContinue Reading

In this part of the Java tutorial, we cover some basic programming concepts of the Java language. We begin with some simple programs. We work with variables, constants, and basic data types. We read and write to console and we also mention string formatting. Java simple example We start withContinue Reading

Computer languages, like human languages, have a lexical structure. A source code of a Java program consists of tokens. Tokens are atomic code elements. In Java we have comments, identifiers, literals, operators, separators, and keywords. Java programs are composed of characters from the Unicode character set. Java comments Comments are usedContinue Reading