image-ru-00-21

"वाह, एक और सुंदर महिला! लेकिन इस बार काले बालों वाली। कितना रोमांचक है!"

"हाय, मेरा नाम किम है।"

"हाय, मेरा नाम अमीगो है!"

"मैं जानती हूँ। मैंने ही आपके नाम का सुझाव दिया था। डिएगो को इस बात का विचार नहीं आया।"

अमीगो के विचार इलेक्ट्रान्स की गति से दौड़ने लगे। "मम्म... वह कितनी अच्छी है... मुझे आश्चर्य है कि उसे रोबोट पसंद हैं।"

"आइए वापस पाठ पर चलते हैं। मैं आपको सरल शब्दों में सामग्री समझाऊँगी।"

"ठीक है।"

"प्रोफेसर और ऋषि ने जो कहा मैं उसमें कुछ और जोड़ना चाहती हूँ।"

"Java में, आप कमांड्स लिख सकते हैं, लेकिन आप कोड में उन कमांड्स के लिए कमेंट्स भी जोड़ सकते हैं। कम्पाइलर कमेंट्स को पूरी तरह से नज़र अंदाज कर देता है। जब प्रोग्राम चलता है, सभी कमेंट्स छोड़ दिए जाते हैं।"

"मुझे एक उदाहरण बताएं।"

"अवश्य:"

public class Home
{
    public static void main(String[] args)
    {
        /*
        Now we'll display the phrase 'Amigo Is The Best' on the screen
        */
        System.out.print("Amigo ");
        System.out.print("Is ");
        System.out.print("The ");
        System.out.print("Best");
    }
}

"हमने 'अब कमेंट जोड़ दिया 'अब हम वाक्यांश प्रदर्शित करेंगे…' कमेंट की शुरुआत निम्न संकेत से (/*) और अंत निम्न संकेत से (*/) की जाती है। जब प्रोग्राम को कम्पाइल किया जाता है तो कम्पाइलर इन संकेतों /* और */ के बीच मौजूद हर एक चीज को छोड़ देता है।"

"क्या इसका यह मतलब है कि मैं कुछ भी लिख सकता हूँ?"

"हाँ। आमतौर पर, कोड में कमेंट्स कोड के उस हिस्से से संबंधित होता हैं जिसे समझना मुश्किल होता है। कुछ कमेंट्स में दर्जनों स्ट्रिंग्स होती हैं, अक्सर मेथड्स के शुरू होने से पहले यह बताने के लिए लिखी जाती हैं कि कोई विशिष्ट मेथड कैसे काम करता है।"

"कोड में कमेंट जोड़ने का एक और तरीका भी है। आप दो फॉरवर्ड स्लैश (//) का उपयोग कर सकते हैं।"

public class Home
{
    public static void main(String[] args)
    {
        System.out.print("Amigo ");
        System.out.print("Is The "); // This is also a comment
        System.out.print("Best");
    }
}

"यहाँ, // से शरू हो कर लाइन के अंत पर //तक मौजूद कोड को एक कमेंट माना जाता है। दूसरे शब्दों में, 'कमेंट को पूरा करने' के लिए इस्तेमाल किए जाने वाले प्रतीकों की कोई दूसरी जोड़ी नहीं है।"

"वैसे, कुछ कमेंट्स वास्तव में दिलचस्प होते हैं।"

// I'm not responsible of this code. They made me write it, against my will.
// Dear future me. Please forgive me.
// I can't even begin to express how sorry I am.
// If I see something like this once more, I'll have a complete mental breakdown at work.
// If this condition is ever satisfied,
// please inform me for a reward. Phone: xxx-xxx-xxx.
// Dear maintainer:
// Once you are done trying to 'optimize' this routine,
// and have realized what a terrible mistake that was,
// please increment the following counter as a warning
// to the next guy:
// total_hours_wasted_here = 42
// When I wrote this, only God and I understood what I was doing
// Now, God only knows
// Sometimes I believe compiler ignores all my comments.
// I dedicate all this code, all my work, to my wife, Darlene, who will
// have to support me and our three children and the dog once it gets
// released into the public.
// Drunk, fix later
// Magic. Do not touch

"हाँ, कुछ कमेंट्स बहुत मज़ाकिया होते हैं।"

"आज के लिए बस इतना ही।"

यह छोटा लेकिन दिलचस्प पाठ था। धन्यवाद, किम।"