Back to Top

Sunday 15 January 2012

JAVA : What if the static modifier is removed from the signature of the main method?

 Program compiles. But at runtime throws an error “NoSuchMethodError”.

13 Responses to “ JAVA : What if the static modifier is removed from the signature of the main method? ”

Anonymous said...
16 October 2012 at 17:27

you can write "static public void" or "public static void"...it doesn't matter. if you remove "static" from the main method signature you will need an instance of that class in order to execute it....for example:

if you want to just run a Java app in a batch environment MainClass.main(String[]) is called....which can happen because the main method is static and does not require an instance of an object. If main was not static you would have to execute that method like this:

MainClass mainClass = new MainClass();
mainClass.main(String[]);


Unknown said...
9 December 2015 at 22:36

Can you write one example sir?


Dipanwita said...
10 August 2018 at 15:21

great blog. java training in chennai


Unknown said...
4 September 2018 at 11:54

Thank you a lot for providing individuals with a very spectacular possibility to read critical reviews from this site.

Embedded System training in Chennai


Unknown said...
26 February 2019 at 00:02

Good Work .


kirankumar said...
22 June 2019 at 14:54

Great information provided
Sanjary Academy provides excellent training for Piping design course. Best Piping Design Training Institute in Hyderabad, Telangana. We have offer professional Engineering Course like Piping Design Course,QA / QC Course,document Controller course,pressure Vessel Design Course, Welding Inspector Course, Quality Management Course, #Safety officer course.
Piping Design Course in Hyderabad ­


Nisha San said...
6 July 2019 at 17:29

Hey, would you mind if I share your blog with my twitter group? There’s a lot of folks that I think would enjoy your content. Please let me know. Thank you.
Java Training in Chennai | J2EE Training in Chennai | Advanced Java Training in Chennai | Core Java Training in Chennai | Java Training institute in Chennai


Priya Gupta said...
16 September 2021 at 18:12

Web designing institute in Noida
Web designing and development institute in Noida
PHP Training institute in Noida


Ziyad22233 said...
2 October 2023 at 06:07

Yalova
Hatay
Muş
Bursa
Mersin
5KNR


26F6CLaura2FFBD said...
13 November 2023 at 03:29

599B2
Mersin Evden Eve Nakliyat
Kripto Para Nedir
Şırnak Evden Eve Nakliyat
Silivri Çatı Ustası
buy deca durabolin
oxandrolone anavar for sale
buy pharmacy steroids
Gümüşhane Evden Eve Nakliyat
testosterone propionat for sale


5D46EMichael6F2B5 said...
23 December 2023 at 12:25

AD512
sohbet
konya sesli sohbet odası
sohbet odaları
hakkari yabancı görüntülü sohbet
sinop sohbet sitesi
çorum görüntülü canlı sohbet
manisa canli sohbet chat
konya en iyi sesli sohbet uygulamaları
agri canlı görüntülü sohbet odaları


2C079Alaina5130E said...
6 January 2024 at 20:36

BEC5E
Bitcoin Kazanma Siteleri
Tiktok İzlenme Hilesi
Mexc Borsası Güvenilir mi
Sohbet
Coin Kazma Siteleri
Bitcoin Kazanma
Bitcoin Nasıl Alınır
Shinja Coin Hangi Borsada
Spotify Takipçi Satın Al


4AFDDKenzie165F3 said...
19 January 2024 at 21:01

1DB2A
Bitcoin Çıkarma
Tumblr Takipçi Hilesi
Meta Coin Hangi Borsada
Parasız Görüntülü Sohbet
Coin Nasıl Üretilir
Pi Network Coin Hangi Borsada
Bitcoin Madenciliği Nedir
Dlive Takipçi Hilesi
Kripto Para Nasıl Çıkarılır


Post a Comment

Popular Posts

Subscribe via Email
Subscribe Java Interview Questions via Email
All Rights Reserved JAVA INTERVIEW QUESTIONS | Privacy Policy | Anijit Sarkar