How to call static method?

Answers were Sorted based on User's Feedback



How to call static method?..

Answer / 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

How to call static method?..

Answer / ravikiran

with the class name

Is This Answer Correct ?    6 Yes 1 No

How to call static method?..

Answer / ranganathkini

A static method may be called in 2 ways:

1. Thru the class reference
2. Thru the instance reference of the class

Is This Answer Correct ?    6 Yes 2 No

How to call static method?..

Answer / ravi jain

Simplest thing to remember is

ClassName.staticMetohdName();

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Core Java Interview Questions

What are E and PI?

1 Answers  


Does windows 10 need java?

0 Answers  


What is covariant return type?

0 Answers  


Can there be an abstract method without an abstract class?

0 Answers  


What is void class in java?

0 Answers  






Explain about sets?

0 Answers  


Can private members of a base class are inheritable justify?

0 Answers  


Why Java is a platform independent language?

6 Answers   Wipro, Zensar,


Can a class be declared as static?

0 Answers  


How finally used under exception handling?

0 Answers  


What are the Static and Dynamic Variables? Differentiate them.

0 Answers   CGI,


What is the difference between synchronized and synchronized block?

0 Answers  


Categories