Posts Tagged ‘Programming’

For Loops For Zombies

Posted: 3rd October 2009 by Andrew Brown in Tutorials
Tags:

This is a tutorial I wrote for a friend that missed this day in class. However, I would really like to expand upon it in the future, and ideally write a whole book teaching a language. For now though, here is an introduction to using for loops.

For Loops

Note: The example code I use below is Java. However, the only part that is Java is the commands inside the for loop. The actual format of the for loop can be expanded to many other languages where it is the same, such as C#, C++, C, Perl, and PHP.

Java Concept: Difference between objects and classes

Posted: 7th September 2009 by Andrew Brown in Tutorials
Tags:

I’m going to go into an analogy now to help explain, so bear with me.

Think of a deck of cards. There’s 54 cards in a deck. They all share similar properties. They all have a card width, a card height, a suit, and a number (or for face cards, letters.) Now, to represent any one Card, you would create one class that holds this data.

public class Card {
double cardWidth;
double cardHeight;
String suit;
String numberOrFace;
}