---
title: "main() method in java."  
description: "main() method in java."  
author: "Anonymous User"  
published: 2011-07-26  
updated: 2011-07-30  
canonical: https://www.mindstick.com/forum/279/main-method-in-java  
category: "java"  
tags: ["java"]  
reading_time: 1 minute  

---

# main() method in java.

Hi.........\
I have a small [question](https://www.mindstick.com/blog/23175/how-to-solve-neet-question-paper-in-less-time) in java. My question is [simple](https://yourviews.mindstick.com/story/1469/5-simple-ways-to-stay-fit-amp-healthy), why main [method is static](https://www.mindstick.com/interview/2363/why-java-main-method-is-static) in java. I had [google](https://www.mindstick.com/articles/43833/google-lighthouse-and-how-is-it-changing-the-way-we-development-and-design-websites) it and got some [results](https://yourviews.mindstick.com/story/4497/usage-of-baking-soda-magical-results) but those results are not up to mark or I am not satisfy with that answer.\
And also I want to ask that what is [difference](https://www.mindstick.com/articles/157114/good-news-or-bad-news-and-the-difference-is) between these two main method declaration\
\

1. [public](https://www.mindstick.com/blog/11097/java-access-modifiers-the-public-and-the-private-modifiers) [static void](https://www.mindstick.com/interview/2715/can-we-write-static-public-void-instead-of-public-static-void) main([String](https://www.mindstick.com/articles/1527/string-split-in-c-sharp) [] args)
2. public static void main(String args[])\

Thanks.

## Replies

### Reply by Anonymous User

Hi, finally I got solution for this question.

These two types of declaration of array havent no difference. Actually java support both type of array declaration.

Thanks.


---

Original Source: https://www.mindstick.com/forum/279/main-method-in-java

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
