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

Where can I get Python online training?
You can get many institutes in google which are providing online training.
Taranum
why string class is override in euals()/ hashCode Hethods?
Equals method and hash code methods compare two objects based the memory location occupied by objects. Two different objects always occupy two different locations in heap memory. So equals and hashCode...
Rami Reddy
What is the general syllabus covered in core Java training from any institution?
you can check the syallbus on http://felix-its.com/java-training-pune/
Shiv Kohli
0 0
5
in java every thing is in the form of object
Everything is object is java except primitive data types like int,long etc..thats the reason its not 100 % object oriented language..
Abrar
Sir tell me some tips to code in java?
If you know C / C++ already, just try how will you able to achieve same examples in java. I prefer try to understand the fundamental of java and create small programs, then make the connectivity among them. Slowly build an application.
Nitinkumar

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

Ask a Question

Related Lessons

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

Facebook Analytics
Assume how the Facebook application will store the millions of customer's record in real-time: facebook = { 'jose': { 'name': 'jose', 'age': 33, 'hobby': , # cricket,football 'mobile': 1111111111, 'email':...

Lambda Expressions in Java
A lambda expression, introduced in Java 8 is similar to a block of code resembling an anonymous function that can be passed to constructors or methods for execution as an argument. Examples: a)() ->...

Example of DependsOnMethod in TestNG
public class dependsonM { @Test public void login() { System.out.println("login"); } @Test (dependsOnMethods = {"login"}) public void email() { //Intentionally I am failing this testcase Assert.assertTrue(false);...
S

Sarthak C.

0 0
0

Basic Concepts of Web Designing
An introduction to domain names, web servers, and website hosting 1)What is the web? In a nutshell, the web is a whole bunch of interconnected computers talking to one another. The computers (on the...

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