UrbanPro

Learn Java Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Why do we use â??public static void mainâ?? only in Java?

Asked by Last Modified  

Follow 5
Answer

Please enter your answer

This is neccesary because main() is called by the JVM before any objects are made. Since it is static it can be directly invoked the class. Similarly, we use staticsometime for user defined methods so that we need not to make objects. voidindicates that the main() method being declared does not return...
read more

This is neccesary because main() is called by the JVM before any objects are made. Since it is static it can be directly invoked the class. Similarly, we use staticsometime for user defined methods so that we need not to make objects. voidindicates that the main() method being declared does not return a value.

read less
Comments

IT Professional Trainer with 10+ years of experience in IT industry

public static void main() main() is the starting point of any java program and your code write inside it. Without it you can not execute console progem in java
Comments

Algomitra Java Tutor

Every computer program needs a starting point of execution and the static main function is the starting point of execution in Java language. Now it was a choice of the language designers of Java to make it that way. But there is a reason to make it static because if it is not static then JVM has to create...
read more

Every computer program needs a starting point of execution and the static main function is the starting point of execution in Java language. Now it was a choice of the language designers of Java to make it that way. But there is a reason to make it static because if it is not static then JVM has to create an instance of the class where the main method is then it has to call the main method, which is an extra overhead in terms of performance.

read less
Comments

Technical Trainer IT With Overall Experience of 10+ Years

Whenever we use static keyword before any function it means that the function can be invoked when required without using object. And main() is the function that starts the execution of program. So the function to be invoked by JVM it has to be public. It has to be static so that it can be invoked without...
read more

Whenever we use static keyword before any function it means that the function can be invoked when required without using object. And main() is the function that starts the execution  of program. So the function to be invoked by JVM it has to be public. It has to be static so that it can be invoked without creating any object. We can use any other return type like int instead of void if we want main() to return any value. 

read less
Comments

View 2 more Answers

Related Questions

I am mechanical student. Can you please tell me opportunities in software field?
Yes, you can get an opportunity. I have seen many mechanical, chemical and biotechnology students are working in its sector. For that, you have to learn some IT courses.
Sainathgowd
what is serialVersionUID , why it different for each bean? serialVersionUID = 42L;
The serialization runtime associates with each serializable class a version number, called a serialVersionUID, which is used during deserialization to verify that the sender and receiver of a serialized...
Srilatha N
Why do many software engineers not like Java?
Opinions on programming languages can vary, but some software engineers may express dissatisfaction with Java for reasons such as perceived verbosity, boilerplate code, and a slower pace of language evolution...
Guruprasad
0 0
5
Can I build iPhone apps using Python?
Yes, you can use PyMob app where apps can be written purely in Python, and the compiler tool flow converts them in native source codes for various platforms. But there are some cons on using PyMob, the...
Sunil
0 0
5
What is the use of package in JAVA?
Have you ever observed why we all are having kitchen / hall / bedroom or any? Have you ever observed why most of the bags contains zips and folders ? Have you ever observed why people create different...
Pushpendra

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

jOOQ 3.10 Supports JPA Attribute Converter
One of the cooler hidden features in jOOQ is the JPADatabase, which allows for reverse engineering a pre-existing set of JPA-annotated entities to generate jOOQ code. For instance, you could write these...

Class, Object and Methods in JAVA
Lesson-1: Class, Object and Methods of Java can be compared with body, heart and brain. Without these 3 things, Java does not exist. If you Google the above 3 items, you will find many definitions. But...

Java : Compile-time Versus Runtime optimization
While designing and development, one should think in terms of compile-time and run-time.It helps in understanding language basics in a better way.Let's understand this with a question below : What...
S

Advance Java
1) Servlet • Basics of Servlet • Servlet Request • Servlet Collaboration • Servlet Config • Servlet Context • Attribute • Session Tracking • Event and Listener •...
A

Why we need to learn Programming languages?
Language is medium for communication. If two parties like to communicate or exchange the thoughts they must know a language. Language should be understandable by both the Parties. For example A wants to...

Recommended Articles

Java is the most commonly used popular programming language for the creation of web applications and platform today. Integrated Cloud Applications and Platform Services Oracle says, “Java developers worldwide has over 9 million and runs approximately 3 billion mobile phones”.  Right from its first implication as java 1.0...

Read full article >

Java is the most famous programming language till date. 20 years is a big time for any programming language to survive and gain strength. Java has been proved to be one of the most reliable programming languages for networked computers. source:techcentral.com Java was developed to pertain over the Internet. Over...

Read full article >

Designed in a flexible and user-friendly demeanor, Java is the most commonly used programming language for the creation of web applications and platform. It allows developers to “write once, run anywhere” (WORA). It is general-purpose, a high-level programming language developed by Sun Microsystem. Initially known as an...

Read full article >

In the domain of Information Technology, there is always a lot to learn and implement. However, some technologies have a relatively higher demand than the rest of the others. So here are some popular IT courses for the present and upcoming future: Cloud Computing Cloud Computing is a computing technique which is used...

Read full article >

Looking for Java Training Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for Java Training Classes?

The best tutors for Java Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Java Training with the Best Tutors

The best Tutors for Java Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more