In Java why we write public static void main(String args[])
why not main()?

Answer Posted / suresh.t.c

public static void main(String arg[])

public for accessing all object

static for to call main method without instance

void main for not returning values for avoid compilation errors

String arg[] is ,in input takes as strings so takes multiple inputs declared String with array of arg[]

Is This Answer Correct ?    14 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many times finalize method will be invoked? Who invokes finalize() method in java?

578


Explain hashset and its features?

586


What is a numeric format?

574


How to make a write-only class in java?

579


How to instantiate static nested classes in java?

566






What is floor in java?

562


How can you write a loop indefinitely in java programming?

556


What are different access specifiers in java?

569


explain different ways of using thread? : Java thread

576


Does java arraylist maintain insertion order?

553


What is a stack class in java ?

614


Is map sorted in java?

572


What is class forname?

548


Explain the JDB in depth & command line.

575


What are untrusted applets?

592