Look at my code carefully.....
[code=java]
class Super
{
protected int a;
}
class Derived extends Super
{
protected int a; //Here Data Overriding or Data Hiding
}
[/code]
Let's look at another example .....
[code=java]
class Super
{
public static void test()
{
//Some content
}
}
class Derived extends Super
{
public static void test() //Here Method Overriding or Method Hiding
{
//Some content
}
}
[/code]
Plz explain .... Hiding and Overrinding for Method and Data ... for both.
Kind regards,
Dmjpro.
[code=java]
class Super
{
protected int a;
}
class Derived extends Super
{
protected int a; //Here Data Overriding or Data Hiding
}
[/code]
Let's look at another example .....
[code=java]
class Super
{
public static void test()
{
//Some content
}
}
class Derived extends Super
{
public static void test() //Here Method Overriding or Method Hiding
{
//Some content
}
}
[/code]
Plz explain .... Hiding and Overrinding for Method and Data ... for both.
Kind regards,
Dmjpro.
Comment