What is a static method?



What is a static method?..

Answer / Kavita Tiwari

A static method in Java is a method that belongs to the class itself, rather than to any instance of the class. It can be called using the class name instead of an object of that class. Static methods cannot access non-static variables or call non-static methods directly because they are not associated with an object instance.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Java Related AllOther Interview Questions

What is a java singleton?

1 Answers  


What is the difference between map and flatmap in java?

1 Answers  


What is use of jpa?

1 Answers  


What is rxjava2?

1 Answers  


Can optional be null?

1 Answers  


What is gwt in java?

1 Answers  


For each of the following program segments,give a big zero analysis for the running time 1.For (i=0;i<m;i++) { // } 2.For (j=0;j<i;j++)

1 Answers   St. Pauls University,


What is the singleton class in java?

3 Answers  


How to implement Thread

2 Answers  


What is singleton pattern in java?

1 Answers  


Spring framework ---Can somebody explain me in easily understandable format about AOP, IOC and DI, so that i can explain in interview rather than just telling what is available in net. I am not able to understand that also. I am new to Spring

1 Answers  


In a barber shop there are 2 doors. customer come in 1 door, leave in other. minimum # of chairs. barber spend his life in cutting. always barber can cut 1 customer. few chairs in the shop. if barber busy customer waits, if chairs full, customer leave. if no customer, barber sleeps. treat barber and customer as 2 threads. you can use Semaphore class with arrive and depart and count as parameter.

1 Answers   NCR,


Categories