Skip to main content

Java basic tutorial

4 replies [Last post]
elitehussar
Offline
Joined: 2010-05-28
Points: 0

http://learnbyexamples.org
At least since the first edition of Kernighan and Ritchie’s The C Programming Language it’s been customary to begin programming tutorials and classes with the “Hello World” program, a program that prints the string “Hello World” to the display. Being heavily influenced by Kernighan and Ritchie and not ones to defy tradition we begin similarly.
http://learnbyexamples.org/java/java-tutorial/java-tutorial-1-hello-worl...

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
elitehussar
Offline
Joined: 2010-05-28
Points: 0

http://learnbyexamples.org
[B]Java Tutorial 5 – Arrays[/B]
In non-trivial computing problems you often need to store lists of items. Often these items can be specified sequentially and referred to by their position in the list. Sometimes this ordering is natural as in a list of the first ten people to arrive at a sale. The first person would be item one in the list, the second person to arrive would be item two, and so on. Other times the ordering doesn’t really mean anything such as in the ram configuration problem of the previous chapter where having a 4 MB SIMM in slot A and an 8 MB SIMM in slot B was effectively the same as an 8 MB SIMM in slot A and a 4 MB SIMM in slot B. However it’s still convenient to be able to assign each item a unique number and enumerate all the items in a list by counting out the numbers.

http://learnbyexamples.org/java/java-tutorial/java-tutorial-5-arrays.html

Message was edited by: elitehussar

elitehussar
Offline
Joined: 2010-05-28
Points: 0

http://learnbyexamples.org
[B]Java Tutorial 4 – Methods[/B]
All the programs we’ve written to date have been quite simple, well under fifty lines of code each. As programs grow in size it begins to make sense to break them into parts. Each part can perform a particular calculation and possibly return a value. This is especially useful when the calculation needs to be repeated at several different places in the program. It also helps to define a clearer picture of the flow of the program, much like an outline shows the flow of a book.
http://learnbyexamples.org/java/java-tutorial/java-tutorial-4-methods.html

elitehussar
Offline
Joined: 2010-05-28
Points: 0

http://learnbyexamples.org
[b]Java Tutorial 3 – The For Statement and Operators[/b]

Java isn’t as redundant as perl, but there’s still almost always more than one way to write any given program. The following program produces identical output to the Fahrenheit to Celsius program in the preceding section. The main difference is the for loop instead of a while loop.

http://learnbyexamples.org/java/java-tutorial/java-tutorial-3-the-for-st...

elitehussar
Offline
Joined: 2010-05-28
Points: 0

http://learnbyexamples.org
[b]Java Tutorial 2 – Classes and Objects: A First Look[/b]
Classes are the single most important feature of Java. Everything in Java is either a class, a part of a class, or describes how a class behaves. Although classes will be covered in great detail in section four, they are so fundamental to an understanding of Java programs that a brief introduction is going to be given here.

http://learnbyexamples.org/java/java-tutorial/java-tutorial-2-classes-an...