First Program of Java ?

Java ke pahle program ko dekhne se phle hum java ke kuch basic syntax ke baare me jaan lette hain.

Java ek case sensitive language h jiska mtlab ye h ki Java small letter(Lower case) or capital letter(upper case) alphabets ko alag alag traha se treat karti h. Agar apne c,c++ phadi h to ap ise aur behtar tarike se smjh sakte hain.

Java 99.9% object oriented programming ke style ko follow karti hai. Iska mtlb y h ki java me likhe gaye programs 100% OOPs k rules ko follow nhi krte per java bhut hi karib h 100% ke. Java me kuch issues hain jinke vajha se isse 100% OOPs k karib nhi kha jata h.

Java me jab programmer koi function bnyga to vo kisi na kisi class ka member function hoga hi hoga. Jayse hum baat kre c++ ki usme main function kisi bhi class ka member function nhi hota h but java ki baat kre to usme main() function bhi kisi na kisi class ka member function hota h. Iska mtlb java me jitne bhi code likhe jaynge vo sub object oriented style me hi likhe jaynge.


Objects states and behaviors hote hain kisi bhi class ke. Object real world entity hota h jayse ek animal h to uska kuch color hoga, uska koi naam hoga or uski koi bread(नस्ल) hogi to ye oose object ki state khlaygi. Thik isi trha ek program me program ke class ka name class ka type or function ka naam or uska type State khlata h. Agar hum baat kre behavior ki to kisi animal me uske bolne ki voice, uske body ka structure oos animal ka behavior khlta h thik ayse hi ek program me oos program ki functionality uska behavior khlaata h. For example vo program addition perform karga ya file ko read/write krega e.t.c.


Java me  ek class ko aap kisi object ka blueprint/template kh skte jo ki usi class k thorough define kiya gya ho.


Kisi bhi programming language me functions ko hi method kha jata h. Java ke ek program ke ek class me kai saare method define kiye ja skte hain. Methods ka mtlab h ki program ka behavior kysa hoga ya program kayse functionality perform krega. For Example agar hum ek addition ka program bnaa rahe h to add krna hi uss program ki khasiyaat hogi.

Write a program(WAP) to print Hello Java?

public class HelloJava //Class name


       public static void main(String arg[])


    System.out.println(“Hello Java”);



es program ko samjhne se phale kuch baate jaan lenna bhut jaruri h jayse jo loog c++ se familiar hain unko pta hoga Class keyword ke phle koi bhi access specifier nhi likha jaata. aur class ke body k last me semicolon(;) lagta h.

Line number one(public class HelloJava) :- Public ek access specifier h. Agar apne c++ phari h to apko pta hoga C++ me Three type k access specifier hote hain (public, private , protected) Lekin java me Four type ke access specifiers hote hain(public, private, protected and default). Agar java me kisi class ke samane mention h ki vo class(like public class, private class, protected class) k आगे public likha h to vo class type ki hogi, protected likha to protected type ki hogi, ya private hai to private type ki hogi. Agar class keyword k age kuch nhi likha h to vo defult class hogi. Aab baat krte hain dusre word class ki ye to apko pata hi h ye keyword h. Acha program bnate time yaad rahiye agar ap class keyword likh rahe hain to uske age ya to public lagaiye(लगाइए) ya kuch na likhiye vo by-default default class ho jaygi. Yhaan per hum protect ya private kyo nhi lga skate iske baaare me hum baad ko paat krenge. Iske baat likha h HelloJava  ye class ka naam h per kuch different tarha se likha hua h jayse apne ne English me padha hoga capital latter(A to Z) alphabets small latter alphabets (a to z) thik vayse hi JAVA me camel case hota h jayse MS-Word me hum sentence case use krte hain iska mtlab ye h ki phla Alphabet capital latter me or sub small me. Java ne ek standard maintain kiya h jisme java ka khna h ki aap jitni bhi classes banaoge unsabko aap CAMEL CASE me hi likhoge isse ek baat or asaan ho jaati h aagar apse koi bhi java k program me apse puch le ki iss program me kitni classes use hue hain to aap bari hi asaani se bta skte ho. Bus apko camel case me likhe words ko dhunaa h or bta dena h.

Line number second( { ) :- Iss sing ko programming language me Braces({) khate hain. In braces ka use kisi program ke class ya function ki body start krne k liye kiya jata h.

Line number Three( public static void main(String args[]) ):- Chaliye ab iss line ka matlb samjhte hain. Iss line ka phala word h public apko pta h ye access specifier h orr hain aak baat ka dhyaan rakhiyega aap jaab bhi koi java me koi program banaoge usme aak class to hogi hi hogi or uski main class ya to public hogi ya default or ak baat or yaad rakhiyega java me main() function me access specifier hamesa public hi hoga. Iss chij ko apko yaad kr lenna h is line me ak word bhi change nhi hoga isme aap koi changes nhi kr sakte hain ise aak rule ki maan lijiye bus apko ise smjhna h. public key word main function me iss liye lgya jata h taaki JVM(java virtual machine) use bhaar se call kr sake. Ab next word h static acha yhaan static kyo likha agar aapne c++ padha h to apko pta hoga yhaan per static keyword kyo istamal hua h. Agar apne kisi function ya variable k samne static keyword likh diya h to uss object ya variable ko hum bagyar object ke call kr skte hain. Iske baad likha h void jiska mtlab h function kuch bhi return nhi krega. Iske baad likha h String args[] bracket me acha agar apne dhyaan diya hoga to apko pta hoga String ka S capital latter me h matlb String ek class h or args[] ak string variable h ye bracket me iss liye likhe gaye hain kyoki inko as argument pass kiya gya h main() function k through.

Line number four again ( { ) :-  Ye open braces h mayne apko line number 2 me bta diya h ye main() function k niche use hua h iska direct mtlb yahi h ki yhan se main() ki body start h isse phle ye class HelloJava me lga tha iska mtlb ki class ki body vhan se start thi.

Line number five (System.out.println(“Hello Java”)):- System ka S capital h mtlb ki System ek class h. Acha ab may jo iske baad batane ja raha hun uske aakadm yaad kr lijiye kyoki ye apke java shikhne ki series me bhut aage taak kaam aane vala h. Agar kisi class ke aage laga h dot(.) to defiantly hum kis class ke static member ko call kr rahe hain vo static member ak variable bhi ho skta ho or function bhi. Agaar apne c++ pdha h to apko pta hoga kisi static member function ko access karne k liye scope resolution lgna hota tha per java me hum dot operator ka use krte hain. Agar apne class ka naam likha or uske aage dot(.) operator lgya to iska mtlab h aap likhne vale hain kisi static member ka naam to ye out kya h ye out h reference variable. Reference variable kysa static reference variable h. To System class ke ander ek reference variable h jiska naam out hai aab uske aage likha h .println to ye out refer kr raha println() function ko jiske andr aak argument pass hua h ak message k form me “Hello java”. Agar aap ko output screen per koi bhi message print krna h to dual codes mi likh dijye vo print ho jayga.

Line number six and seven me h ( } ) :- Line number six vale ne main() function ke braces band kiye hain or seven vale ne HelloJava class ke.

About padhoindiapadho

Padho India Padho is an Online E-learning Platform where our Experts provide Padho India Padho users good quality content in general Hindi

View all posts by padhoindiapadho →

53 Comments on “First Program of Java ?”

  1. I just want to say I’m new to blogging and certainly loved this web blog. More than likely I’m planning to bookmark your website . You surely have perfect articles and reviews. Kudos for sharing with us your webpage.

  2. Good site! I really love how it is easy on my eyes and the data are well written. I’m wondering how I might be notified whenever a new post has been made. I have subscribed to your RSS feed which must do the trick! Have a nice day!

  3. I simply wanted to jot down a simple remark so as to say thanks to you for some of the unique concepts you are giving out at this site. My long internet research has now been rewarded with excellent tips to share with my family and friends. I would state that that we site visitors are very much endowed to live in a fine network with many wonderful professionals with beneficial points. I feel very much grateful to have used your weblog and look forward to really more exciting minutes reading here. Thank you once again for all the details.

  4. Definitely believe that which you said. Your favorite justification seemed to be on the web the simplest thing to be aware of. I say to you, I definitely get annoyed while people consider worries that they plainly don’t know about. You managed to hit the nail upon the top and defined out the whole thing without having side-effects , people could take a signal. Will likely be back to get more. Thanks

  5. Apple previously contains Rhapsody as an app, which is a excellent get started, nonetheless it is previously hampered via the inability in direction of retailer regionally on your iPod, and is made up of a dismal 64kbps bit cost. If this adjustments, then it will rather negate this usefulness for the Zune, yet the 10 audio per month will nonetheless be a large plus in just Zune Pass’ choose.

  6. Apple by now has Rhapsody as an application, which is a ideal start off, yet it is at present hampered by way of the inability in direction of shop regionally upon your iPod, and incorporates a dismal 64kbps little bit value. If this adjustments, then it will considerably negate this benefit for the Zune, however the Ten songs per month will nonetheless be a big as well as in just Zune Pass’ favor.

  7. hello there and thank you for your information – I’ve certainly picked up anything new from right here. I did however expertise some technical points using this website, since I experienced to reload the site a lot of times previous to I could get it to load correctly. I had been wondering if your hosting is OK? Not that I am complaining, but slow loading instances times will very frequently affect your placement in google and could damage your quality score if ads and marketing with Adwords. Anyway I am adding this RSS to my email and can look out for a lot more of your respective intriguing content. Ensure that you update this again soon..

  8. I am no longer sure the place you’re getting your info, however good topic. I must spend some time learning much more or working out more. Thank you for wonderful info I was searching for this information for my mission.

  9. I wish to show my admiration for your generosity supporting individuals who really want guidance on in this area of interest. Your real commitment to getting the message across became astonishingly good and have regularly helped guys and women like me to get to their ambitions. Your amazing insightful information indicates much to me and even more to my mates. Many thanks; from each one of us.

  10. I think this is one of the most significant info for me. And i’m glad reading your article. But should remark on some general things, The site style is great, the articles is really nice : D. Good job, cheers

  11. I really like your writing style, excellent info, thank you for posting :D. “Your central self is totally untouched By grief, confusion, desperation.” by Vernon Howard.

  12. I precisely needed to appreciate you once again. I do not know what I could possibly have handled without those concepts provided by you about such question. Certainly was a very traumatic concern for me, nevertheless encountering your specialized strategy you managed that forced me to leap over delight. Extremely happy for the help as well as trust you recognize what a powerful job that you are putting in instructing others thru your webpage. Probably you’ve never met all of us.

  13. The new Zune browser is incredibly good, nevertheless not as positive as the iPod’s. It works effectively, however is not as instantaneous as Safari, and contains a clunkier interface. If yourself sometimes software on making use of the web browser which is not an issue, nonetheless if you happen to be planning towards examine the world-wide-web alot from your PMP then the iPod’s more substantial show and superior browser could possibly be critical.

  14. Thank you a bunch for sharing this with all folks you actually understand what you’re speaking approximately! Bookmarked. Please also seek advice from my web site =). We could have a hyperlink exchange contract between us!

  15. The Zune concentrates upon currently being a Moveable Media Player. Not a web browser. Not a video game machine. Possibly within the potential it’s going to do even far better in these areas, yet for by now it truly is a Good course in the direction of set up and pay attention in the direction of your music and films, and is without having peer inside of that regard. The iPod’s benefits are its web going to and applications. If these good additional persuasive, possibly it is your best choice.

  16. Fingers down, Apple’s application retailer wins by way of a mile. It can be a significant variety of all styles of applications vs a quite unhappy selection of a handful for Zune. Microsoft includes courses, specially inside the realm of games, nevertheless I’m not confident I might need to have in the direction of wager on the potential if this part is essential in the direction of your self. The iPod is a much far better determination within just that case.

  17. The fresh new Zune browser is astonishingly positive, but not as Great as the iPod’s. It is effective perfectly, still just isn’t as immediate as Safari, and consists of a clunkier interface. If oneself sometimes method upon getting the world wide web browser that is not an issue, nevertheless if you are designing in direction of study the world-wide-web alot against your PMP then the iPod’s more substantial display and greater browser could possibly be necessary.

  18. I will gear this assessment in the direction of Two versions of individuals: present-day Zune property owners who are considering an upgrade, and persons attempting in the direction of make your mind up between a Zune and an iPod. (There are other avid gamers importance considering out there, such as the Sony Walkman X, nonetheless I expect this presents your self ample data towards deliver an mindful alternative of the Zune vs players other than the iPod line as effectively.)

  19. The new Zune browser is incredibly optimistic, still not as Fantastic as the iPod’s. It operates well, still is just not as prompt as Safari, and contains a clunkier interface. If oneself often plan upon working with the world wide web browser that’s not an issue, but if you are building to read the web alot against your PMP then the iPod’s larger display screen and improved browser may perhaps be significant.

  20. If you’re however on the fence: grab your beloved earphones, mind down to a Suitable Acquire and check with in direction of plug them into a Zune then an iPod and view which 1 appears superior in direction of yourself, and which interface tends to make your self smile additional. Then you can expect to recognize which is specifically for yourself.

  21. Arms down, Apple’s application retail store wins through a mile. It truly is a massive selection of all sorts of apps vs a alternatively unhappy variety of a handful for Zune. Microsoft incorporates Options, in particular in the realm of video games, nonetheless I am not absolutely sure I would require to bet on the potential if this characteristic is sizeable in the direction of you. The iPod is a much much better determination in just that case.

  22. Apple currently incorporates Rhapsody as an application, which is a great start, yet it is at the moment hampered by the incapability in direction of shop regionally upon your iPod, and contains a dismal 64kbps bit cost. If this alterations, then it will to some degree negate this benefit for the Zune, however the 10 audio per month will however be a significant moreover in Zune Pass’ choose.

  23. If you’re nevertheless upon the fence: seize your preferred earphones, brain down in direction of a Least complicated Order and inquire in the direction of plug them into a Zune then an iPod and watch which 1 seems improved towards on your own, and which interface results in on your own smile far more. Then you can notice which is immediately for your self.

  24. If you’re continue to upon the fence: get your beloved earphones, brain down to a Suitable Get and ask to plug them into a Zune then an iPod and watch which one particular seems far better toward you, and which interface results in your self smile extra. Then you will notice which is immediately for oneself.

  25. lovely take commercial competitiveness because of the indian subcontinent profoundly

    that e book declared that “so long as of india on purpose [url=]uc browser app[/url] generates a fair placement on transnational option traders, it can be posture an issue on behalf of china and taiwan, it became from a Beijing structured individual arranged are thinking casual Anbound, And an overview was already carried doing Thursday’s international occasions publication.China’s state government media channels ordinarily discounted price India’s growth as a potential condition to the country, and the best discuss India’s democracy for a problem.unquestionably the article was indeed an exotic comparison, arguing which Narendra Modi government had succeeded in training India’s upvc profile among transnational businesses and sometimes even thriving in appealing to china agents that will offer a long term encourage to china’s websites, in accordance with the wonder tank,essentially, india comes with the circumstances to copy China’s income growing muscle mass brand because of it is big body in addition to viewers, very low work cost and enormous world, which often can be all much China’s growing conditions. not surprisingly, the car went ahead and added, “overseas real estate investors are currently undecided. on top of that, there is exciting signs and symptoms that particular asia will doing well in bringing in a lot more trading, what china will have to assume truly,the country’s varied domestic area of interest, very low labor expense together with professional sector exist there a large percentage of rewarding specs. being China’s group dividend diminishes, china, due to half of that citizenry within age 25, Is poised to make the most, these storie identified.chinese retailers having INDIAIt of course specific to be able to “progressively more truly sellers” committing to the native american location, for mobile suppliers Vivo, Oppo not to mention Xiaomi, to whom china is actually proving itself to be nevertheless trade instantly kathmandu, on top of truly innovation services that had been successful in the most recommended products and services in american indian segment, away from UC browser when you need to particular booklet understood, “it is very useful which often japanese companies’ investment option in of india employs moved at the hands of exclusively approaches to research moreover emergence (R rapidly overheat, eastern telecom company Huawei know-how Co put in $170 million to spread out an R clinic in Bengaluru, and simply introduced the will join prime minister Narendra Modi’s ‘Make in India’ advertising and marketing campaign,china a possible customer GROUPIt came a similar via China’s distinctive financial growth post, indicating any “the changes that are happening in china can point out important possibility advance, “With a sizable culture of most students, Which isn’t just the manual work compel additionally it is a potential consumer’s bunch, china has associated with going to volatile economical growth when you need it. therefore,, should absorb the introduction of this unknown neighbour. our researchersraised an issue: any time china thought we would copy indonesia, those things that trauma wouldn’t it include in addition to really need to chinese suppliers use? due to replicating cina, china might additionally put together an internet monetary climate coupled with expand his / her facilities the work, with the help of financial commitment based evolution. basically, indian may turn by themselves on the road to india 2.0, in addition to the allow world funds identify whether to invest in far east or indian,which it bemoaned the fact small number of far east take into account goes down as well certified people appeared to be agreeing to of india honestly a good deal of. “it must be remarked that china’s websites have not handled quantity scientific tests on asia, a new have reason to believe fish tank shown. “in the prospective related to talk about dive bombs, china and taiwan are certainly not possible until the indian subcontinent thrives onto an apparently talented competition earlier speaking coping with the situation. so, kathmandu have to have experience a more beneficial adding muscle quickly technique for the new creation or it becomes a regrettable bystander taking care of India’s great success. tibet should speculate coupled with see the rise using the of india market cautiously. With an adolescent folks, it may fairly easy for the growing advertise economic system become china’s websites 2.0 to realize the eye together with overall world investment funds.

  26. Amongst me and my spouse we’ve owned even further MP3 avid gamers about the yrs than I can depend, like Sansas, iRivers, iPods (classic & touch), the Ibiza Rhapsody, and so forth. But, the previous several a long time I have settled down to just one line of players. Why? Since I was joyful toward check out how well-designed and exciting to hire the underappreciated (and extensively mocked) Zunes are.

  27. Involving me and my partner we’ve owned excess MP3 gamers earlier mentioned the decades than I can rely, including Sansas, iRivers, iPods (classic & touch), the Ibiza Rhapsody, etc. But, the ultimate several several years I’ve fixed down in direction of a person line of players. Why? Because I was happy toward take a look at how well-designed and pleasurable towards hire the underappreciated (and widely mocked) Zunes are.

  28. The fresh new Zune browser is astonishingly Terrific, nevertheless not as Terrific as the iPod’s. It works properly, nonetheless just isn’t as fast as Safari, and has a clunkier interface. If on your own at times system on employing the net browser that is not an issue, but if you might be coming up with toward study the world wide web alot towards your PMP then the iPod’s much larger show and much better browser may be sizeable.

  29. I really intend to reveal to you that I am new to posting and clearly enjoyed your work. Most likely I am going to save your blog post . You absolutely have excellent article material. Get Pleasure From it for telling with us your favorite domain webpage

  30. I intended to write you one bit of word to finally give many thanks once again with the spectacular techniques you have featured on this page. It has been quite seriously open-handed with you to convey unhampered just what many individuals would have supplied for an e book in making some profit for their own end, certainly since you might well have done it if you wanted. The techniques likewise worked to become fantastic way to be sure that other individuals have the identical dream similar to my very own to understand a lot more regarding this issue. I am certain there are a lot more pleasurable sessions up front for individuals who check out your blog.

  31. Thanks for writing this awesome article. I’m a long time reader but I’ve never been compelled to leave a comment. I subscribed to your blog and shared this on my Twitter. Thanks again for a great article!

  32. Faytech North America is a touch screen Manufacturer of both monitors and pcs. They specialize in the design, development, manufacturing and marketing of Capacitive touch screen, Resistive touch screen, Industrial touch screen, IP65 touch screen, touchscreen monitors and integrated touchscreen PCs. Contact them at, 121 Varick Street, New York, NY 10013, +1 646 205 3214

  33. MetroClick specializes in building completely interactive products like Photo Booth for rental or sale, Touch Screen Kiosks, Large Touch Screen Displays , Monitors, Digital Signages and experiences. With our own hardware production facility and in-house software development teams, we are able to achieve the highest level of customization and versatility for Photo Booths, Touch Screen Kiosks, Touch Screen Monitors and Digital Signage. Visit MetroClick at or , 121 Varick St, New York, NY 10013, +1 646-843-0888

  34. The Zune concentrates on getting a Transportable Media Player. Not a website browser. Not a video game machine. Potentially within the foreseeable future it’ll do even much better inside of those areas, nevertheless for by now it’s a fantastic direction in the direction of arrange and pay attention in direction of your new music and flicks, and is with no peer in just that regard. The iPod’s benefits are its website browsing and programs. If those people stable even further persuasive, probably it is your suitable preference.

Leave a Reply

Your email address will not be published. Required fields are marked *