Why static variables and methods in java called directly ?Are they stored
in some different memory location?
Why static variables are directly called without any use of object in
java?Are they stored in some different memory location?And why only static
methods can called with the name of the class directly without creating
its object ?for example
class First
{
public static void ss()
{
System.out.println("This genius will give answer");
}
}
class Second
{
public static void main(String ar[])
{
First.ss();
}
}
No comments:
Post a Comment