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...

Why do we use public static with the main function in Java?

Answer Posted / shekhar chauhan

public static void main()- firstly, public which r used
globly access this method in our whole progam. and static
basically used for that we can used only one main method in
whole program.we can not create object that class. so we
make static main method.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is meant by null and void?

977


What is immutable state?

1031


What are the characteristics of java?

1055


What is the difference between abstract class and interface1? What is an interface?

1081


Explain implementation and how is it different from conversion?

1086


What is variable declaration and definition?

1005


What is the advantage of preparedstatement over statement?

1113


What are the differences between the constructors and methods?

1126


What are the 3 types of loops in java?

1086


What is the use of default method in interface in java? Explain

1006


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.

2054


What is use of a abstract variable?

991


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

1092


What is difference between static and abstract class?

1004


What is the maximum size of array in java?

985