Inheritance(1)- Introduction

Before you begin with inheritance read this story. An employee named Tom is working for XXX company as a Java developer. Tom is working on a project. His boss asked him to design a code for different shapes. He explained him- “There will be different shapes (square, triangle and circle). Each shape will have two … Continue reading Inheritance(1)- Introduction

Advertisements

If- Else (conditional statement)

If and else are known as conditional statements. Conditional statements  are those statements which allows  flow of execution of the program based on certain condition to be true or false. These are the basic conditional statements: if statement if-else statement nested if-else statement   If statement: Syntax: Boolean expression means condition. To execute the if code boolean_expression … Continue reading If- Else (conditional statement)

Object Behavior

You already learned about object in previous tutorial. But you had many queries regarding objects - Why Objects? What’s its use? In previous tutorials you wrote codes in a class with main method.  Ever wondered if you can create methods(like bark(), hungry()) in a class other than the main method class. What we are trying to say … Continue reading Object Behavior