Why is the main method static in Java?
Answer / nashiinformaticssolutions
Java's main() function is static by default, allowing the compiler to call it either before or after creating a class object. The main () function is where the compiler begins programme execution in every Java programme. Thus, the main () method needs to be called by the compiler. If the main () method is permitted to be non-static, the JVM must instantiate its class when calling the function.
| Is This Answer Correct ? | 0 Yes | 0 No |
Why singleton is not thread safe?
1) There are 10 different threads in runnable state. Each having priority 1 to 10. How does the CPU schedules or executes these threads?
These static constructors are correct ? class A { statc intA() { } static A(int x,int y) { } static A(int x) { } }
What is difference between fileinputstream and filereader in java?
Can we override private method in java?
They had given one progam final HashMap hm=new HashMap(); public void show() { hm.put("name",value); } in this prg here the final hashtable value can be changed in put method,its the prg run?
Which containers may have a MenuBar?
What is a functional interface?
Does set allows null in java?
What is means by DLL file means ? What is the use of DLL file? What are the contents of DLL file?
Difference between JVM and JRE?
Explain access modifiers in java.