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

How do you remove an element from an arraylist in java?

460


What happens when a thrown exception is not handled?

578


Explain list interface?

515


What is the base class in java from which all classes are derived?

515


Can an object subclass another object?

552






What is derived datatype?

623


Can we override static methods in java?

581


What is meant by distributed application? Why are we using that in our application?

545


os is developed in c no java is more secured then c na why dont the os developed is developed using java

3518


how to create multithreaded program? : Java thread

501


Why set is used in java?

566


Is there any limitation of using inheritance?

569


How many boolean functions are there?

502


What do you mean by synchronized non access modifier?

560


Define jre i.e. Java runtime environment?

572