hi all,
i have studied that a static method or variable is always associated with the class and can not be accessed with the object reference. i was trying this in a program, but the object of the class in which static is defined is able to acces the method. how is this possible. pl. clearify my problem and about static method and static class. the code is as follows -
<CODE>
class sachin
{
static void h() //static method
{
System.out.println("in static sachin");
}
};
public class
test extends sachin //extend class
{
public static void main(
String[] args)
{
test t=new test();
sachin s= new sachin();
s.h();
t.h();
}
}
</code>