Search This Blog

Friday, March 25, 2011

Hello World Program

class Hello {

    public static void main(String[] arguments) {
    System.out.println("Hello world");
    }
} 


व्याख्या :
इस प्रोग्राम को हमने क्लास से शुरू किया है | साधारणतह सभी प्रोग्राम क्लास के नाम से ही शुरू होते है | क्लास का नाम कुछ भी हो सकता है | यह हमेशा केपिटल अक्षर से शुरू होता है | जैसे हमने लिखा क्लास हेल्लो |
क्लास का नाम लिखने के बाद ब्रेअकेट लगाना होता है | यह ब्रेअकेट क्यो लगाते है यह में आपको बाद में बताऊंगा | अभी के लिए बस इतना याद रखे की यह लगाना अनिवार्य है | प्रोग्राम हमेशा शुरू भी इससे होगा और अंत भी इससे ही होगा | एक और जरुरी बात , प्रोग्राम को हमेशा क्लास नाम से ही सेव करते है | 

इस प्रोग्राम में लिखी अगली लाइन public static void main को आपको याद करना है | यह लाइन कही प्रोग्राम में इस्तमाल होने वाली है | पब्लिक का अर्थ है की यह किसी भी जगह प्रयोग में लाया जा सकता है , स्टेटिक का अर्थ है यह बदले का नहीं , वोइड का अर्थ है की इसका कोई उत्तर नहीं है एवं मैन का मतलब है दरवाजा (प्रोग्राम का प्रवेश द्वार )  स्ट्रिंग[] में दो ब्रेकेट लगे है , जब भी आप ऐसे कोई ब्रेकेट देखे तो समझ  जाए की यह एक अर्रे है |  

सिस्टम एक कॉन्सोल है , प्रिंट एलेन किसी शब्द को स्क्रीन पर इंकित करने के लिए काम में आता है | अगर हम प्रिंट एलेन की जगह प्रिंट का ही उपयोग करे तो  लाइन नहीं बदलेगी , मतलब हम अगली लाइन में नहीं जायेगे |
(println मतलब  नेक्स्ट लाइन में  प्रिंट करो ,प्रिंट  लिखने पर  वोह  वही  पर  प्रिंट  होगा) |

इसको और ज्यादा समझने के लिए इसको चला के देखें | इसके साथ खेले और कोई समस्या हो तोह मुझे कमेन्ट में लिखे |

13 comments:

  1. hello sir my name is mayank kya apki id he gmail ya facebook
    ye meri id he messi9888@gmail.com

    ReplyDelete
  2. program हम class के ही नाम से किव सेव करते है!

    ReplyDelete
    Replies
    1. Dear Sir, thanks for for your comment. You have asked one of the most pertinent question but I don't have any specific answer for that but Java do lot of things just to maintain the level of consistency even if programmers are spread around the world.Or in simple words we can say that these minors things force you to follow good programming practices and make you learn things which is followed by all the others experienced programmers doing.

      Delete
  3. veryyyyyyyyyyyyyyyyyyyyyyy nicccccccccccccccccccceeeeeeeeeeeeeeee

    ReplyDelete
  4. This is best notes ever. It is very useful those people who wants learn java in a easy way and short time. Sir can you please provide a PDF file format of java notes in Hindi.

    ReplyDelete
    Replies
    1. Thanks Raziq, I am thinking of writing to couple more articles before publishing PDF. Once I publish it, I will upload the download link here.

      Delete