What is the use of static keyword in "public static void
main()"

Answer Posted / mary kamal

Static keyword is identified by jvm at the time of class loading,so main() function is the jvm known function it should be identified at the time of class loading...so hence it is named as static

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by an interface in java?

570


What is a consumer in java?

564


how to create multithreaded program? Explain different ways of using thread? When a thread is created and started, what is its initial state? Or extending thread class or implementing runnable interface. Which is better? : Java thread

591


What is java used for on a computer?

507


What is an error in java?

637






What is a marker interface?

574


Explain public static void main(string args[]) in java.

528


Is it possible to cast an int value into a byte variable? What would happen if the value of int is larger than byte?

542


what is the purpose of "virtual"?

564


Can we overload run() method in java?

593


Explain the difference between static and dynamic binding in java?

540


Does importing a package imports its sub-packages as well in java?

552


how to split string in java?

647


What is the difference between static and global variables and also define what are volatile variables?

549


What are the types of methods in java?

576