Why do we need public static void main(String args[])
method in Java...?
Answer / shadow
We need
• public: The method can be accessed outside the
class / package
• static: You need not have an instance of the class
to access the method
• void: Your application need not return a value, as
the JVM launcher would return the value when it exits
• main(): This is the entry point for the application
If the main() was not static, you would require an instance
of the class in order to execute the method.
....!
$HADOW
Is This Answer Correct ? | 14 Yes | 0 No |
What do you mean by compiler?
What are the Memory Allocations available in JavaJava?
import java.io.*; class Demo { public static void main(String args[]) { File f=new File("1234.msg"); String arr[]=f.list(); System.out.println(arr.length); } }
Can we make a constructor final?
Is nan false?
What is "this" keyword in java? Explain
What is a function easy definition?
Is java platform independent?
What are the differences between string and stringbuffer?
How will you override default serialization mechanism in java
Why java doesn’t support multiple inheritances?
Why do we use public static with the main function in Java?
13 Answers College School Exams Tests, Infosys,