What Is public static void main(String[ ] args) - MeraForum Community.No 1 Pakistani Forum Community

MeraForum Community.No 1 Pakistani Forum Community

link| link| link
MeraForum Community.No 1 Pakistani Forum Community » The World of Information » Computer and Information Technology » Java » What Is public static void main(String[ ] args)
Java All about Java Programs

Advertisement
 
Post New Thread  Reply
 
Thread Tools Display Modes
(#1)
Old
Morash's Avatar
Morash Morash is offline
 


Posts: 17,781
My Photos: ()
Country:
Star Sign:
Join Date: Jul 2010
Location: ▌║█║▌│█│║▌║
Gender: Male
?? CLASS 3: What Is public static void main(String[ ] args) - >>   Show Printable Version  Show Printable Version   Email this Page  Email this Page   04-01-2014, 09:17 AM




What Is public static void main(String[ ] args)



The public keyword is an access specifier, which allows the programmer to control the visibility of class members. When a class member is preceded by public, then that member can be accessed by code outside the class in which it is declared.In this case, main( ) must be declared as public, since it must be called by code outside of its class when the program is started. The keyword static allows main( ) to be called without having to instantiate a particular instance of the class. This is necessary since main( ) is called by the Java interpreter before any objects are made. The keyword void simply tells the compiler that main( ) does not return a value. As you will see, methods may also return values.

As stated, main( ) is the method called when a Java application begins. Keep in mind that Java is case-sensitive. Thus, Main is different from main. It is important to understand that the Java compiler will compile classes that do not contain a main( ) method. But the Java interpreter has no way to run these classes. So, if you had typed Main instead of main, the compiler would still compile your program. However, the Java interpreter would report an error because it would be unable to find the main( ) method.

Any information that you need to pass to a method is received by variables specified within the set of parentheses that follow the name of the method. These variables are called parameters. If there are no parameters required for a given method, you still need to include the empty parentheses. In main( ), there is only one parameter. String args[ ] declares a parameter named args, which is an array of instances of the class String. Objects of type String store character strings. In this case, args receives any command-line arguments present when the program is executed.


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


 





bE driveN wiTh puRpOse, Be r313n71355 in your alιgnмenт;
with excellence.
pAy n0 mInd to the ∂ιsιмραssισηε∂ เ๓ק๏tєภt ђคtєгร

.. нoolιgan

Last edited by Morash; 04-07-2014 at 11:25 PM.. Reason: Title Updated
Reply With Quote Share on facebook
Sponsored Links
(#2)
Old
PRINCE SHAAN PRINCE SHAAN is offline
 


Posts: 7,688
My Photos: ()
Country:
Join Date: Jul 2010
Location: PAKISTAN
Gender: Male
Default Re: What Is public static void main(String[ ] args) - >>   Show Printable Version  Show Printable Version   Email this Page  Email this Page   04-01-2014, 11:32 AM

thanks for nice sharing............

 

(#3)
Old
AYAZ's Avatar
AYAZ AYAZ is offline
 


Posts: 12,370
My Photos: ()
Country:
Star Sign:
Join Date: Aug 2008
Location: Karachi
Gender: Male
Default Re: What Is public static void main(String[ ] args) - >>   Show Printable Version  Show Printable Version   Email this Page  Email this Page   04-01-2014, 02:52 PM

Morash regarding commands can you describe it in urdu version as well like what you know about it rather than whole definition. It will ease the way for us to learn it and remember it.

 







ALLAH FARMATA HAI :
AEY BANDEY JO HUA
WO ACHA HUA .
JO HORAHA HAI ACHA HO RAHA HAI.
JO HOGA WO BHI ACHA HOGA.
TERA KIYA GAIYA JO TU ROTA HAI
TU KIA LAYA JO TU NE KHO DIYA.
JO LIYA YAHIN (DUNYA) SEI LIYA
JO DIYA YAHIN (DUNYA) PE DIYA
JO AAJ TERA HAI PEHLAY KISI AUR KA THA
AUR KAL KISI AUR KA HOGA.
TABDEELI KAINAAT KA MAMOOL HAI
BAS TU WO JAMA KAR JO TU SATH LEI KAR JANEY WALA HAI
YANI NAIK AMAAL.


(#4)
Old
Akash Akash is offline
The Bold And Beautiful
 


Posts: 1,111
My Photos: ()
Country:
Star Sign:
Join Date: Feb 2014
Location: Peshawar
Gender: Male
Default Re: What Is public static void main(String[ ] args) - >>   Show Printable Version  Show Printable Version   Email this Page  Email this Page   04-01-2014, 02:58 PM

Nice..

 






(#5)
Old
Morash's Avatar
Morash Morash is offline
 


Posts: 17,781
My Photos: ()
Country:
Star Sign:
Join Date: Jul 2010
Location: ▌║█║▌│█│║▌║
Gender: Male
Default Re: What Is public static void main(String[ ] args) - >>   Show Printable Version  Show Printable Version   Email this Page  Email this Page   04-01-2014, 10:49 PM

Quote:
Originally Posted by AYAZ View Post
Morash regarding commands can you describe it in urdu version as well like what you know about it rather than whole definition. It will ease the way for us to learn it and remember it.
public Hamare Paas Ek Keyword Hai Jo Hum Class K Saath Lagate Hai, Public Hone Ki Wajah Se Hum Ye Class Program Mai Kahin Bhi Call Kar Sakte Hai, Second Type private Hai Ye Wo Class Hai Jis Ko Program Mai Class Se Bahir Call Nahi Kar Sakte ..

static Hamare Paas Ek Keyword Hai Jisy Hum Use Kare To Phir Os Class Ko Call Karne K Liye Object Banane Ki Zarorat Nahi Parti ..

void Keyword Jab Hum Use Karte Hai To Eska Matlab Hai K main() Function Ka Koi Return Type Nahi Hai ..

String[ ] args Hamare Paas Ek String Type Array Hai Characters Store Karne K Liye ..

 





bE driveN wiTh puRpOse, Be r313n71355 in your alιgnмenт;
with excellence.
pAy n0 mInd to the ∂ιsιмραssισηε∂ เ๓ק๏tєภt ђคtєгร

.. нoolιgan
(#6)
Old
AYAZ's Avatar
AYAZ AYAZ is offline
 


Posts: 12,370
My Photos: ()
Country:
Star Sign:
Join Date: Aug 2008
Location: Karachi
Gender: Male
Default Re: What Is public static void main(String[ ] args) - >>   Show Printable Version  Show Printable Version   Email this Page  Email this Page   04-02-2014, 02:00 AM

Thanks morash for explanation really help.

 







ALLAH FARMATA HAI :
AEY BANDEY JO HUA
WO ACHA HUA .
JO HORAHA HAI ACHA HO RAHA HAI.
JO HOGA WO BHI ACHA HOGA.
TERA KIYA GAIYA JO TU ROTA HAI
TU KIA LAYA JO TU NE KHO DIYA.
JO LIYA YAHIN (DUNYA) SEI LIYA
JO DIYA YAHIN (DUNYA) PE DIYA
JO AAJ TERA HAI PEHLAY KISI AUR KA THA
AUR KAL KISI AUR KA HOGA.
TABDEELI KAINAAT KA MAMOOL HAI
BAS TU WO JAMA KAR JO TU SATH LEI KAR JANEY WALA HAI
YANI NAIK AMAAL.


(#7)
Old
pakeeza's Avatar
pakeeza pakeeza is offline
 


Posts: 28,336
My Photos: ()
Country:
Star Sign:
Join Date: Jan 2012
Location: Maa ki duaon mey
Gender: Female
Default Re: What Is public static void main(String[ ] args) - >>   Show Printable Version  Show Printable Version   Email this Page  Email this Page   04-03-2014, 08:21 AM

Thnksss For Info

 



Be Positive... Everything Gonna be Alright

(#8)
Old
PRINCE SHAAN PRINCE SHAAN is offline
 


Posts: 7,688
My Photos: ()
Country:
Join Date: Jul 2010
Location: PAKISTAN
Gender: Male
Default Re: What Is public static void main(String[ ] args) - >>   Show Printable Version  Show Printable Version   Email this Page  Email this Page   04-03-2014, 07:54 PM

THANKS FOR SHARING

 

(#9)
Old
Morash's Avatar
Morash Morash is offline
 


Posts: 17,781
My Photos: ()
Country:
Star Sign:
Join Date: Jul 2010
Location: ▌║█║▌│█│║▌║
Gender: Male
Default Re: What Is public static void main(String[ ] args) - >>   Show Printable Version  Show Printable Version   Email this Page  Email this Page   04-06-2014, 07:34 PM

Thanks Everyone ..

 





bE driveN wiTh puRpOse, Be r313n71355 in your alιgnмenт;
with excellence.
pAy n0 mInd to the ∂ιsιмραssισηε∂ เ๓ק๏tєภt ђคtєгร

.. нoolιgan
Post New Thread  Reply

Bookmarks

Tags
args, mainstring, public, static, void

« Previous Thread | Next Thread »
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Distributing From CM to Public ĶįňĢ őf ĻōVęŘ Political Issues Of Pakistan 28 03-16-2013 02:15 PM
~!~ [ Public Ads That Makes You Think... ] ~!~ ~!~hasnain~!~ Pics And Images 8 04-04-2012 11:55 AM
Public Transportation in Cuba Aslam Pics And Images 4 12-29-2011 10:08 AM
! pUBLIC TOILET ! Hussain Funny Sms 17 11-09-2011 06:20 PM
New Robot Arm Uses Static Cling to Grab Objects in Zero-G, From Satellites to Space Junk eXquisite Inception Space & Aviation 2 10-15-2011 03:17 AM


All times are GMT +5. The time now is 03:11 PM.
Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.

All the logos and copyrights are the property of their respective owners. All stuff found on this site is posted by members / users and displayed here as they are believed to be in the "public domain". If you are the rightful owner of any content posted here, and object to them being displayed, please contact us and it will be removed promptly.

Nav Item BG