How to call static method?

Answer Posted / maharajan j

Static methods we can call without class reference.We don't
need to create an object of that particular class.

For example:
class A{

static void disp(){
sysout("Java")
}
}
class B{

B(){
A.disp();
}

}

Is This Answer Correct ?    13 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is an object null?

558


What is string literal in java?

553


Why deletion in linkedlist is fast than arraylist?

533


What is the major drawback of internal iteration over external iteration?

584


What is a method header?

544






What are data types in programming?

546


What is %02d?

575


Is intellij better than eclipse?

539


What is intern method in java?

580


What is difference between iterator and enumeration in java?

522


Can you inherit a constructor java?

571


Can a main method be declared final?

581


What is local class in java?

518


What is variable declaration and definition?

541


How is tree Mirroring implemented?

627