Correct syntax for main method

0 votes

There are multiple ways of creating main(). Here are some of the most common ways that I have seen it being created

public static void main(String args[])

or

public static void main(String[] args)

What is the correct way to do do this? What is the difference?

Jun 6 in C# by rajiv
• 1,620 points
17 views

1 answer to this question.

0 votes

Both ways are correct. But taking the documentation into consideration, this is the expected way of doing this

public static void main(String[] args){...}

So, you could say that this is more conventional and accepted to the developers.

answered Jun 7 by pranav
• 2,580 points

Related Questions In C#

0 votes
1 answer
0 votes
1 answer

C# class without main method

Not every single class need the main ...READ MORE

answered Jul 7 in C# by krishna
• 2,540 points
17 views
0 votes
1 answer

Which design pattern to use for pre-process process and post-process task

You have pre-defined and precise steps to ...READ MORE

answered Jun 9 in C# by rajiv
• 1,620 points
30 views
0 votes
1 answer

Need a fast C# tutorial for (short-term) non-.Net programmers

First use this link http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/ Second, ask them ...READ MORE

answered Jun 9 in C# by rajiv
• 1,620 points
11 views
+6 votes
16 answers

How do backend of these really cool games work?

Most of the games these days don't ...READ MORE

answered Jul 19, 2018 in Career Counselling by Kalgi
• 52,350 points
7,418 views
0 votes
0 answers

Update test results @ test step level in Azure DevOps during test execution through automation scripts

My automation framework is writtin in Java, ...READ MORE

Aug 21, 2020 in DevOps on Cloud by Anand
• 120 points

recategorized Aug 21, 2020 by MD 501 views
0 votes
1 answer

What are major differences between C# and Java

Instead of listing out mutiple points, I ...READ MORE

answered Jun 9 in C# by rajiv
• 1,620 points
20 views
0 votes
3 answers

Trying to upload files using Selenium(C#)

You can try using Javascript Executor to ...READ MORE

answered Aug 23, 2019 in Selenium by Abha
• 28,120 points
4,514 views
0 votes
1 answer

C# books or web sites for C++

I would recommend checking out C# in ...READ MORE

answered Jun 6 in C# by pranav
• 2,580 points
22 views
0 votes
1 answer

Are these interview questions too challenging for beginners?

As a new employee, I would expect ...READ MORE

answered Jun 11 in C# by pranav
• 2,580 points
25 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP