Joel Explains: Java
Compiler vs. Interpreter
Compiler – Checks syntax.
Interpreter – Checks syntax.
Compiler – Generates machine-code instructions. Running the program is a separate step.
Interpreter – Executes the program statements as it converts them to machine-code.
Compiler – Is not needed to run the executable program.
Interpreter – Must remain installed while program is run.
Compiler – Runs faster.
Interpreter – Is slower.
Generally, when you compile a program, you’re creating machine language for a specific platform. For example, you might compile a program to run on a Windows 2000 platform. If you want to run the same program on an Apple computer, you can use a compiler that creates machine language for a Mac OS X platform.
When you compile a Java program, it doesn’t create machine language, it creates bytecode. To run a Java program, the computer running the program needs a Java Virtual Machine to convert the bytecode into machine language. This arrangement allows you to write once, then run anywhere that has a Java Virtual Machine.
Java programs can be written in any text editor, such as Microsoft Notepad. When you save a Java program, you should save it with a .java extension. For example, if you were to create a program that writes the famous phrase “Hello world“, you might save it as HelloWorld.java.
In addition to using the .java extension, you should use UpperCamelCase for the program name. CamelCase is the practice of writing compound words or phrases where the words are joined without spaces or dashes or underscores, and each new word is capitalized. The name comes from the camel-like “bumps” in the middle of the compound word that are created by the uppercase letters. When you name something in CamelCase that starts with a lower case letter, it’s referred to as lowerCamelCase. In Java, there’s a convention that you should use lowerCamelCase for variable names. On the other hand, names starting with an upper case letter are referred to as UpperCamelCase. The compiler, however, doesn’t care which case you use for any of these names, as long as you are consistent.
To compile Java programs using the Standard Edition of the Java 2 platform, you need to download the current JDK.
To compile HelloWorld.java, you type in javac HelloWorld.java at the MS-DOS Prompt (in Windows 95/98) or Command Prompt (in Windows NT/XP/Vista). This will create bytecode in HelloWorld.class.
To run HelloWorld.class, you type java HelloWorld.class.
A HelloWorld program could look like this:
class HelloWorld
{
public static void main(String[] args)
{
System.out.println("Hello World");
}
}
The first line starts with the word class. This is just a reserved word that tells java that we’re building a new class. The other word on the first line is HelloWorld. This is the name that we have chosen for this class, and it MUST match the program name. By convention, all class names should be UpperCamelCase so programmers will recognize that it is a class name, not a variable name. The entire first line is a class header.
The second line of the program is an opening curly brace. This defines the beginning of the class body. The last line of our program is a closing curly brace. This indicates the end of our class. Everything between these two curly braces is part of class HelloWorld.
The HelloWorld class contains one method. Method is just another name for something that is called a function, procedure, paragraph, or subroutine in other languages. It’s a block of code that can be called from another location. In this case, it’s called from the run statement. All java applications start at a method named main().
The third line is a method header for the main() method. It’s followed by curly braces that define the body of the method and enclose a println statement that sends the literal “Hello World” to the screen.
This particular method starts with the word public. Public is an access modifier. It lets Java know who’s allowed to call this method. Public is the least restrictive access modifier.
The next word is static. Static changes main() from an instance method to a class method. Yes, I understand that you don’t know what this means yet.
Static is followed by the word void, which indicates that the main method doesn’t send a value back to the place that called it. If it did return a value, we would replace the word void with the data type of the returned value.
The method body contains a single statement:
System.out.println(”Hello World”);
It ends with a semicolon. All statements end with a semicolon. Class headers and method headers are not statements.
The word System is a class. It starts with an uppercase letter.
The word out is an object.
The word println() is a method.
The statement System.out.println(); is a method call.
The statement System.out.println(”Hello World”); is a method call that passes a literal argument to the method.
If you’ld like to try it for yourself, here are some good instructions and a closer look at a Hello World program from the folks at Sun.
A good learning path would be to continue writing Applications.
Once you have a good foundation writing applications, you can start learning about Applets.
Running Applets and Building Applets can be more fun than building applications.
At some point, you may want to start using an Integrated Development Environment.
Here are some Java Tips and someStep by Step Programming Tutorials.
You may also want to learn more about the AWT and Swing
Lecture Notes from Intro to Computing at the Free University of Bolzano/Bozen.






Hello,мооаоквеуі
http://filipinocommunityseattle.org/ – order meridia online
It is able to act as a supplement for the aforementioned by affecting the chemicals in your body that are related to weight management.
meridia weight loss
Meridia reduces excess body fat
Best price Meridia! Order Meridia (Reductil) at reputable online pharmacy and save big!
Meridia is a trade name for sibutramine.
meridia online
Avoid the hazardous activities if you start feeling these symptoms and contact your doctor about it.
Thanks much for that great blog post.
Hello,мооаоквеуі
http://filipinocommunityseattle.org/ – meridia no prescription
Some patients have reported an increase in their blood pressure when they started having their treatment using Meridia that is why regularly having your blood pressure and as well as your pulse is strongly advised.
meridia drug
Dizziness, difficulty in concentrating, may occur as a side effect of Meridia.
order meridia online
If you have anorexia nervosa, taking appetite suppressants, have high blood pressure, have heart disease, irregular heartbeats, congestive heart failure, a history of stroke, have epilepsy or a different seizure disorder, have gall stones, glaucoma, liver disease, or kidney disease tell your doctor about it because of the complications that will occur if you take Meridia.
Hello, tuotprffcdddni
cheap xanax
Purchasing Xanax without medication can be dangerous to your health because it can cause addiction to a person.
order xanax online
The medication is not advisable to people that are allergic to benzodiazepines like Librium, Tranzene, Valium, Ativan, Xanax, or Serax.
http://medseaproperty.com/ – generic alprazolam
Xanax And How It Helps Those Suffering From Anxiety
Order low cost Xanax medication online and save your money! No RX!
Xanax is a drug belonging to the group called benzodiazepines.
Great content with regards to diets for weight loss fast . You actually generated some good details there. I did a search on the matter and uncovered a lot of people may come to an agreement with your web site. Were did you get all the info from?lose weight tips
Valuable info. Even I accidentally found your site, I bookmarked it.
I see a lot of good content here, what template do you use ?
I’m kinda interested in the subject too, so I hope you come out with more of the same stuff.
Valuable info. Even I accidentally found your site, I bookmarked it.
Hi, there. I would suggest you continue writing more posts, this would make your blog even more interesting, plus I guess you will get more visitors.
I want to start my first site, what cms do you use and recommend for me ?
Hi. I actually enjoyed reading your writing!. Good quality written content. I would undoubtedly suggest you to create blogposts much more often. By doing this, having such a worthy weblog I think that you may rank better in the search engines
. I also subscribed for your RSS feed. Continue this great job!
I am sure that i will come back here. Well written articles !
Hi. I really enjoyed reading through your current writing!. Top notch material. I might recommend you to do posts much more frequently. Using this method, with such a helpful blog I believe that you could rank better in the search engines
. I also subscribed to your Rss. Carry on the great job!
I like the way you put out things. It would be nice to read more posts from you. Bookmarked.
I saw many blogs but yours is awsome, bookmarked for future referrence.
You can consider me in for a Digg. Thanks for posting this on your site!
Hi. I just want to say that it was a nice reading. I hope you come out with more interesting posts, because I bookmarked your website. All the best.
There is evidently a lot for me to ascertain outside of my books. Thanks for the great read,
I like the way you put out things. It would be nice to read more posts from you. Bookmarked.
insightful post
I like the way you put out things. It would be nice to read more posts from you. Bookmarked.
Very well thought out site. I was bothered by some of the info that was written.
It’s not common these days to find this type of information. I’m glad I stumbled upon your website. Keep up the good work!
Nice to be visiting your blog again, it has been months for me. Well this article that i’ve been waited for so long. I need this article to complete my assignment in the college, and it has same topic with your article. Thanks, great share
Hey could I reference some of the content found in this post if I reference you with a link back to your site?
Hi there can I use some of the information here in this post if I reference you with a link back to your site?
I have been a passionate fan of your site for some time and not actually provided anything back, I am hoping to alter that in the future with an increase of chat.Thanks for another great inclusion on the site.
Hey dear can i publish some paragraph of your article on my small blog of university.I have to create a good pages out there and i do think your post Fits well into it.I will be grateful to give you an source link as well.I have two blogs one my personal and the other which is my college blog.I will publish some part in the university blog.Hope you do not mind.Greetings
I’m kinda interested in the subject too, so I hope you come out with more of the same stuff.
I think your opinions are quite interesting, I enjoy reading what you write. Hope to hear more from you. Subscribed.
I appreciate what you have done here. I like the area in which you mention you do this to provide back but I might consider because of all the comments this is functioning for you at the same time.
Intimately, the post is really the best on this worthy topic. I concur with your conclusions and will thirstily look forward to your incoming updates. Just saying thanks will not just be sufficient, for the great clarity in your writing. I will directly grab your rss feed to stay abreast of any updates. Fabulous work and much success in your business endeavors!
where can i find more info?
This is a really good read for me. Must admit that you are one of the coolest bloggers I ever saw. Thanks for posting this informative article.
How-do-you-do, just needed you to know I have added your site to my Google bookmarks because of your extraordinary blog layout. But seriously, I think your site has one of the freshest theme I’ve came across. It really helps make reading your blog a lot easier.
Thank you for such a fantastic blog. Where else could anyone get that kind of info written in such a perfect way? I have a presentation that I am presently working on, and I have been on the look out for such information.
Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful for me.
That is some inspirational stuff. Never knew that opinions could be this varied. Thanks for all the enthusiasm to offer such helpful information here.
Hypnosis can help you to lose Weight! – http://tinyurl.com/hypnosis-can-help-you
Excellent read, I just passed this onto a colleague who was doing a little research on that. And he actually bought me lunch because I found it for him smile So let me rephrase that: Thanks for lunch!
i know i’m a little off topic, but i just wanted to say i love the layout of your blog. i’m new to the blogegine platform, so any tips on getting my blog looking good would be appreciated.
Though I would’ve loved it much more if you added a relevant video or at least pictures to back up the explanation, I still thought that your write-up quite helpful. It’s usually hard to make a complicated matter seem very easy. I enjoy your weblog and will sign up to your feed so I will not miss anything. Fantastic content
Nice to be visiting your blog again, it has been months for me. Well this article that i’ve been waited for so long. I need this article to complete my assignment in the college, and it has same topic with your article. Thanks, great share.
I admire the valuable information you offer in your articles. I will bookmark your blog and have my children check up here often. I am quite sure they will learn lots of new stuff here than anybody else!
You post awsome posts. Bookmarked !
You post informative articles. Bookmarked !
I just started reading your site – thanks for writing. I wanted to inform you that it’s not displaying correctly on the BlackBerry Browser (I have a Blackberry 9700). Anyway, I am now subscribed to the RSS feed on my PC, so thanks again!
Thanks for this awsome article. Where else could anyone get that kind of information in such a perfect way of writing? I am on the look for such information, as I have a presentation next week.
At long last, an excellent web page that’s not in my face attempting to continuously promote me some thing. Appreciate it, make sure you continue the great work.