Sharat M

Greenhorn
+ Follow
since Jun 26, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Sharat M

Hi Vivek,
Check this code,
class x
{
public int x;
x()
{x=8;
}

static void dispX()
{
System.out.println("Value of X:");
}

static void dispX(int x)
{
System.out.println("Value"+x);
}
}
class y extends x
{
public int x;
y()
{
x=8;
}
static void dispX() // change static to coderanch, you will get and error.
{
System.out.println("Value of y:");
}

}

public class Testjava
{
public static void main(String args[])
{

x a=new x();

y b=new y();

a.dispX();
b.dispX();

}
}

Therefore , when he says nonstatic, when a static method is over-ridden, the access modifier should be static and not public or private or protected.
I hope this makes it clear for you.
Sharat.
How can you identify an object from a given problem?
e.g. Problem is "Accept Login name and Password.Update the values in a file by using encryption algorithms"
[This message has been edited by Sharat M (edited June 26, 2000).]