Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What is the difference between an if statement and a switch statement?

1166


Does sprintf allocate memory?

1112


Explain the transient field modifier?

1048


What is the difference between conversation & casting?

1053


What is jagged array in java?

1088


How many JVMs can run on a single machine and what is the Just-In-Time(JIT) compiler?

1059


Can we create an object of private class?

972


What is the difference between post and put?

1067


What is the java virtual machine?

1095


What is the use of predicate in java 8?

964


Why map is used in java?

1036


What is the longest unicode character?

1156


What is final modifier?

1057


What is 16 bits called?

946


How to sort array in descending order in java?

923