Showing posts with label SYNTAX TO INHERIT IN JAVA. Show all posts
Showing posts with label SYNTAX TO INHERIT IN JAVA. Show all posts

Tuesday, 17 June 2014

Syntax to inherit in Java

Syntax to inherit in Java

-To inherit a class in Java " extends " keyword is used.
-Syntax : 
class <Derive> extends <Base>
-From the view of derive class there are three categories of methods in base class :
1. Constructors :
~ To call constructor of  base class " super " keyword is used.
~Syntax :
   super(< argument >);
~Only derive class constructor can call the constructor of base class that too in first line of derive class.
2. Overridden Functions : 
~To call the overridden function of base class syntax used is :
   super.functionName(< argument >);
3. Normal Functions :
~To call other function syntax used is :
   functionName(< argument >);
~Classes should highly cohesive.

Chapter : 1 - First code in Node JS Previously I have written a blog about Getting Started with Node JS and its installation. Now lets s...