marq

Dr. Charles Simonyi is the Father of Modern Microsoft Excel                                           JavaScript was originally developed by Brendan Eich of Netscape under the name Mocha, later LiveScript, and finally renamed to JavaScript.                                           The word "Biology" is firstly used by Lamarck and Treviranus                                           Hippocrates (460-370 bc) is known as father of medicine.                                           Galene, 130-200 is known as father of Experimental Physology                                           Aristotle (384-322 BC) is known as Father of Zoology because he wrote the construction and behavior of different animals in his book "Historia animalium"                                           Theophrastus(370-285 BC) is known as father of Botany because he wrote about 500 different plants in his book "Historia Plantarum".                                           John Resig is known as Father of Jquery -                                          HTML is a markup language which is use to design web pages. It was invented in 1990 by Tim Berners-Lee.                                                                The Google was founded by Larry Page and Sergey Brin.                                                                Rasmus Lerdorf was the original creator of PHP. It was first released in 1995.                                                               Facebook was founded by Mark Zuckerberg                                                               Bjarne Stroustrup, creator of C++.                                                                Dennis Ritchie creator of C                                                                                                                              James Gosling, also known as the "Father of Java"                                          At 11.44%, Bihar is India's fastest growing state                                          Father of HTML -Tim Berners Lee                                          orkut was created by Orkut Büyükkökten, a Turkish software engineer                    Photoshop: It came about after Thomas Knoll, a PhD student at the University of Michigan created a program to display grayscale images on a monochrome monitor which at the time was called 'Display'.

Java Application Anatomy - Java in Hindi



हमने Java में एक छोटा सा Program Develop किया और उसे Compile करके Run भी कर लिया। अब हम इसकी बनावट व इसके काम करने के तरीके को समझते हैं। सबसे पहली बात तो यही है कि Java Application Standalone Java Programs होते हैं। इन्हें Java Applets की तरह किसी Java Enabled Web Browser की जरूरत नहीं होती है।

Comments in Java
Java में Comments देने के लिए तीन तरीकों का प्रयोग किया जा सकता है। तीनों तरीकों से निम्नानुसार Comment दिया जा सकता है -

/* This is a Comment in Java which Java Compiler Ignores. */

इस /* */ के बीच लिखे गए Comments को Java का Compiler पूरी तरह से Ignore कर देता है। यानी इनके बीच लिखे गए किसी भी Word को Compiler Check नहीं करता है ना ही Compile करता है। ये Comments एक Programmer अपने Program के बीच-बीच में देता रहता है, ताकि उसे उसके Program का Flow पता रहे।

/** Documentation */
इस Comment को Documentation Comment या Doc Comment कहा जाता है। जब हम हमारी किसी Class File का Documentation करना चाहते हैं तो Documentation को /** . . . */ के बीच में लिखते हैं। इस प्रकार के Documentation को Java Developer’s Kit के Javadoc Tool का प्रयोग करके एक अलग Documentation HTML File में Store किया जा सकता है। इस Documentation को अलग File में Store करने के लिए हम Command Prompt पर Javadoc Tool का निम्नानुसार उपयोग करके अपनी Class के लिए Documentation File तैयार कर सकते हैं।

Command Prompt> Javadoc <List of .Java FileNames>

// This is Third Comment Style
जब हमें केवल एक ही Line का Comment देना होता है, तब हम इस तरीके से Comment लिखते हैं। Compiler इस प्रकार के Comments को Ignore कर देता है यानी Compile नहीं करता है। एक बात हमेंशा ध्यान रखें कि एक Comment के अन्दर दूसरा Comments नहीं लिखा जा सकता। यानी Comments की Nesting नहीं की जा सकती है। जैसे

/** Madhav is a Union Leader /* and I am his Friend*/ He is a Programmer too.*/

Java में किसी भी Application Program में कम से कम एक Class जरूर होता है और उस Class में एक main() Method होता है। Java का Compiler इसी main() Method से Java के Application की Compiling शुरू करता है।

Class Statement
इस Program की पहली Code Line को देखिए-

class HelloWorld {

जब इस Program को Compile किया जाता है तब ये Code Line Compiler को ये Instruction देता है कि

| | “Computer, Java के इस Program का नाम HelloWorld Assign कर दे।”  | |

जैसाकि हमने पहले भी बताया था कि एक Program के रूप में हम Computer को जितने भी Instructions देते हैं, वे सभी Statements कहलाते हैं। यहां class Statement वह तरीका है, जिससे हम हमारे Program को एक नाम देते हैं। ये Statement कई अन्य बातों को भी Determine करता है जिसके बारे में हम आगे पढेंगे। class शब्द का सबसे अधिक महत्व ये है कि Java के Programs को भी Class ही कहा जाता है।

इस उदाहरण में हमारे Program का नाम HelloWorld बिल्कुल उसी तरह से लिखा गया है, जिस तरह से हमने Source File में हमारी Class का नाम लिखा है। जैसाकि हमने पहले भी बताया है कि यदि ये नाम समान नहीं होते हैं तो Compilation के समय Error Generate होता है।


main() Statement
Program की अगली Line को देखिए-

public static void main (String[] arguments) {
ये Line Computer को कहती है कि
| |   “Program का Main Part यहां से शुरू हो रहा है।”       | |
Java का Program कई Sections में Organized रहता है, इसलिए हमें एक ऐसे तरीके की जरूरत होती है जिससे ये पता चल सके कि Program का कौनसा हिस्सा पहले Handle होगा और कौनसा बाद में। यहां से आगे हम जितने भी Application Programs Create करेंगे, उन सभी में main Part ही Starting Point होगा।

Bracket Mark
हम देख सकते हैं कि हमारे Program में Brackets का भी प्रयोग हुआ है। ये Bracket किसी भी Java Program का बहुत ही महत्वपूर्ण हिस्सा हैं। Java में ये Bracket Program के विभिन्न हिस्सों को Group करने का तरीका है। Bracket की तरह ही Parenthesis का भी प्रयोग किया जाता है। Opening Bracket व Closing Bracket के बीच जो कुछ भी लिखा जाता है, वह सबकुछ उस Group का हिस्सा होता है। Opening व Closing Bracket के बीच लिखे Statements को Block कहा जाता है।


हम हमेंशा हमारे Program के विभिन्न हिस्सों की शुरूआत को दर्शाने के लिए Opening Bracket “{“ का प्रयोग करते हैं और किसी विशेष हिस्से का अन्त दर्शाने के लिए Closing Bracket “}” का प्रयोग करते हैं। एक Block के अन्दर दूसरे Block को Use किया जा सकता है, जैसाकि हमारे Program में HelloWorld Class के Block में Main() Method के Block Use किया गया है।

main() Method Block के अन्दर जो भी Statement लिखे जाते हैं, वे सभी Statements Computer के लिए Instructions या Commands होते हैं, जिन्हें Computer Execute करता है।

हमने main() Method में निम्नानुसार केवल एक ही Statement लिखा है-
System.out.println(“Hello World”);   //Display this String

ये Statement Screen पर उस Data या Information को Print कर देता है, जिसे इस Statement के Parenthesis में लिखा जाता है। जैसे यदि हम “Hello World” के स्थान पर “Java Is a Web Language” लिख दें, तो Hello World के स्थान पर यही Statement Screen पर Print होगा।

जब किसी Characters के एक समूह हो Double Quote के बीच लिखा जाता है, तो इस Characters के समूह हो String कहा जाता है। यानी “Hello World” व “Java Is A Web Language” दोनों Strings हैं, क्योंकि ये Characters का एक समूह हैं जिन्हें Double Quote के बीच लिखा गया है।

इस तरह से हमने Java का एक साधारण सा Program बनाया। हमें इसी तरह से जावा में विभिन्न Programs Develop करने होते हैं। हम चाहे जो भी Program बनाना चाहें, हमें निम्न Statements तो हमेंशा लिखने ही होते हैं जो Compiler को बताता है कि Program की शुरूआत व अन्त कहां पर हो रहा है।


public class ClassName //Name of the First Class of the Java Program
{ //Starting of the Program Level Class Block
//Other program specific statements
} //End of the Program Level Class Block

Javac Compiler से हम किसी भी Java Class को Compile कर सकते हैं, लेकिन java Interpreter से वही Class Command Prompt पर Run होती है, जिसमें main() Method होता है। इसलिए जिस Class में main() Method होता है, उस Class का नाम ही उस Class की Source File का नाम भी होना जरूरी होता है।

चूंकि जावा एक Highly Case Sensitive Language है, इसलिए जिस प्रकार का नाम हम Class का लिखते हैं, उसी तरीके का नाम हमें Source File का भी रखना होता है। साथ ही Source File का नाम हमेंशा .java Extension के साथ लिखा जाता है, तभी javac Compiler उसे Compile कर सकता है। हमें हमारे Program के जितने भी Codes लिखने होते हैं, वे सभी Codes या Statements हमें Class Block के अन्दर ही लिखने होते हैं।

No comments:

Post a Comment