Java Notes3 PDF
Java Notes3 PDF
default access
specifier used int numberSum (int x, int y, int z)
{ Local variable
int sum;
sum = x+ y + z; Method body
class superclassname
{
//data members Here, ‘extends’ keyword is used
// methods to create a subclass of the
}
superclass which is already
class subclassname extends superclassname defined.
{
//class body
}
A
E.g. Consider 3 classes A, B and C. C is the subclass of B and B is
the subclass of A.
B
In such situation, each subclass inherits all of the traits found in all
of its super classes. Here, C inherits all aspects of B and A.
C