Need to use public,static keywords in main function?
Answer Posted / psreddy
public access modifier we declared then that class visible
to every where and access to any where
bcoz if we write any number business logic classes but
we have to write only one execution logic class for all
these business logic classes
that is why always execution logic class as public
and also there is need of writing static key word
bcoz the execution logic executes only once
other wise we will get runtime exeption
Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
Why do we use threads in java?
Does java allow overriding static methods ?
how can you catch multiple exceptions in java?
When should you use arraylist and when should you use linkedlist?
What is floor math?
What is the functionality of the stub?
Does apple use java?
Give the hierarchy of inputstream and outputstream classes.
Explain the hierarchy of java exception classes?
How to find the largest value from the given array.
Why java does not support pointers?
What best practices should you follow while writing multithreaded code in java?
Can a class have multiple subclasses?
Explain 5 io best practices?
What is java thread dump, how can we get java thread dump of a program?