Why do we need public static void main(String args[])
method in Java...?
Answer Posted / 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 |
Post New Answer View All Answers
How is garbage collection controlled?
How to instantiate member inner class?
Is object a data type in java?
What is the synonym of procedure?
Which is better stringbuilder or stringbuffer?
How objects of a class are created if no constructor is defined in the class?
How to call one constructor from the other constructor ?
Write a code to create a trigger to call a stored procedure
What is e java?
Which of the following is not an isolation level in the JDBC
Draw a UML class diagram for the code fragment given below: public class StringApplet extends Applet { private Label sampleString; private Button showTheString; private ButtonHandler bHandler; private FlowLayout layout; public StringApplet() { sampleString = new Label(" "); showTheString = new Button (" Show the String"); bHandler = new ButtonHandler(); layout = new FlowLayout(); showTheString.addActionListener(bHandler); setLayout(layout); add(sampleString); add(showTheString); } class ButtonHandler implements ActionListener { public void actionPerformed(ActionEvent e) { samplestring.setText("Good Morning"); } } } Note: The methods need not be indicated on the diagram.
Which data type is a class in java?
Can a class have an interface?
What are the java ide's? Explain
What is difference between arraylist and list in java?