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, 2022 in C# by rajiv
• 1,620 points
653 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, 2022 by pranav
• 2,590 points

Related Questions In C#

0 votes
1 answer

What are the correct version numbers for C#?

On Wikipedia, you may find the most ...READ MORE

answered May 31, 2022 in C# by rajiv
• 1,620 points
452 views
0 votes
1 answer

C# class without main method

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

answered Jul 7, 2022 in C# by krishna
• 2,820 points
947 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, 2022 in C# by rajiv
• 1,620 points
1,844 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, 2022 in C# by rajiv
• 1,620 points
535 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
11,414 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, 2022 in C# by rajiv
• 1,620 points

edited Jul 4, 2023 by Khan Sarfaraz 483 views
0 votes
1 answer

How to open a huge excel file efficiently

A good example is using PIA's/Interop or ...READ MORE

answered Oct 27, 2022 in Others by narikkadan
• 63,600 points
649 views
0 votes
1 answer

C# books or web sites for C++

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

answered Jun 6, 2022 in C# by pranav
• 2,590 points
522 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, 2022 in C# by pranav
• 2,590 points
857 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP