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

Hi , this is Mithun Ghosh from Kolkata. I want a suggestion about the course content of teaching Java starting from core to Advanced level. Please anyone do help with a legible course content. Thanks in advance -- Thanks & Regards, Mithun Ghosh
Hi Mithun, This is AkiraITSolutions, We do provide real time training with real time employees, who ever having more than 10 years of IT Experience. For further details please feel free to reach us.
Mithun Ghosh

What are major difference between JAVA & Python? Where you would recommend to use JAVA and where need to use Python?

Python is one of the most used programming language than Java. With the recent Popularity of the Machine learning, Artificial intelligence and Data science Python takes the first place of the Top 5 programming...
Amit Kumar
0 0
5
How do I learn Java? From book or internet or a coaching?
It is good to learn Java from Coaching where you will get more exposure in learning at faster pace.
Suresh
0 0
7
What is Constructor in Java?
1. Constructor is just like a method ( referred as special method as it appearance look like normal methods) 2. It's name is same as class name 3. It doesn't return any value 4. It is invoked/called...
Ujwalajagdale
0 0
8

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

Ask a Question

Related Lessons


Introduction to Programming Languages
What is a Programming Language? A programming language is a formal computer language or constructed language designed to communicate instructions to a machine, particularly a computer. Programming languages...

Tips of learning Java Language/Other Programming Languages
1.You should know the basic concept: If we talk about programming languages so basic concept are same in all the high level languages. So you should know the basic concept firstly then you can easily understand...
I

ICreative Solution

0 0
0

Java Hash Map internal implementation
1.Hash Map internal implementation: In hash map it will create an array of table (to store the {Key,Value} pair) which is of type java.util.HashMap.EntryThe Entry object contains {hash, key, next, value}...
R

JAVA - Object Cloning
JAVA - Object Cloning Is the way of creating the same copy of object without calling the class constructor. It means we can make any class object multiple times without calling its default constructor....

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