Help!! Exception in thread "main" java.lang.NullPointerException

Hi i'm new to java and was wondering what this exception means? heres my code..

/**

* @(#)setGame.java

*

*

* @author

* @version 1.00 2007/2/20

*/

import java.io.*;

class card{

private String number;

private String shape;

private String colour;

private String shading;

public void setShading(String shde){

if(shde.equals("filled")||shde.equals("striped")||shde.equals("empty") ){

shading = shde;

}

else{

System.out.println("error shading property does not compute.");

}

}

public void setColour(String colr){

if(colr.equals("red")||colr.equals("green")||colr.equals("purple")){

colour = colr;

}

else{

System.out.println("error colour property does not compute.");

}

}

public void setShape(String shp){

if(shp.equals("round")||shp.equals("diamond")||shp.equals("squiggly")){

shape = shp;

}

else{

System.out.println("error shape property does not compute.");

}

}

public void setNumber(String num){

if(num.equals("1")||num.equals("2")||num.equals("3")){

number = num;

}

else{

System.out.println("error shape property does not compute.");

}

}

public void DisplayCard(){

System.out.print(number + " ");

System.out.print(shape + " ");

System.out.print(colour + " ");

System.out.print(shading + " ");

System.out.println("");

}

}

class deck{

}

public class setGame {

/**

* Creates a new instance of <code>setGame</code>.

*/

public setGame() {

}

/**

* @param args the command line arguments

*/

public static void main(String[] args) {

card [] cardDeck = new card[81];

// TODO code application logic here

System.out.println("Welcome to Set game!.");

//Creating the shading, shape, and colour properties

//for the 81 cards and storing them into an array.

for(int i=0;i<81;i++){

if(i/27==0){

cardDeck.setShading("filled");

if(i/9==0){

cardDeck.setShape("round");

if(i/3==0){

cardDeck.setColour("red");

}

else if(i/3==1){

cardDeck.setColour("green");

}

else if(i/3==2){

cardDeck.setColour("purple");

}

}

else if(i/9==1){

cardDeck.setShape("diamond");

if(i/3==0){

cardDeck.setColour("red");

}

else if(i/3==1){

cardDeck.setColour("green");

}

else if(i/3==2){

cardDeck.setColour("purple");

}

}

else if(i/9==2){

cardDeck.setShape("squiggly");

if(i/3==0){

cardDeck.setColour("red");

}

else if(i/3==1){

cardDeck.setColour("green");

}

else if(i/3==2){

cardDeck.setColour("purple");

}

}

}

else if(i/27==1){

cardDeck.setShading("striped");

if(i/9==0){

cardDeck.setShape("round");

if(i/3==0){

cardDeck.setColour("red");

}

else if(i/3==1){

cardDeck.setColour("green");

}

else if(i/3==2){

cardDeck.setColour("purple");

}

}

else if(i/9==1){

cardDeck.setShape("diamond");

if(i/3==0){

cardDeck.setColour("red");

}

else if(i/3==1){

cardDeck.setColour("green");

}

else if(i/3==2){

cardDeck.setColour("purple");

}

}

else if(i/9==2){

cardDeck.setShape("squiggly");

if(i/3==0){

cardDeck.setColour("red");

}

else if(i/3==1){

cardDeck.setColour("green");

}

else if(i/3==2){

cardDeck.setColour("purple");

}

}

}

else if(i/27==2){

cardDeck.setShading("empty");

if(i/9==0){

cardDeck.setShading("round");

if(i/3==0){

cardDeck.setColour("red");

}

else if(i/3==1){

cardDeck.setColour("green");

}

else if(i/3==2){

cardDeck.setColour("purple");

}

}

else if(i/9==1){

cardDeck.setShading("diamond");

if(i/3==0){

cardDeck.setColour("red");

}

else if(i/3==1){

cardDeck.setColour("green");

}

else if(i/3==2){

cardDeck.setColour("purple");

}

}

else if(i/9==2){

cardDeck.setShading("squiggly");

if(i/3==0){

cardDeck.setColour("red");

}

else if(i/3==1){

cardDeck.setColour("green");

}

else if(i/3==2){

cardDeck.setColour("purple");

}

}

}

}

//Creating the Number property for the 81 cards

//and storing them into an array.

for(int i=0;i<81;i=i+3){

cardDeck.setNumber("1");

}

for(int i=1;i<81;i=i+3){

cardDeck.setNumber("2");

}

for(int i=2;i<81;i=i+3){

cardDeck.setNumber("3");

}

for(int i=0;i<81;i++)

cardDeck.DisplayCard();

}

}

[5340 byte] By [dets00ba] at [2007-11-26 19:03:04]
# 1
Here is the explanation: http://java.sun.com/j2se/1.5.0/docs/api/java/lang/NullPointerException.htmlAlso when you post code, please use the code formatting tags.
zadoka at 2007-7-9 20:49:47 > top of Java-index,Java Essentials,Java Programming...
# 2
The error I found is that you only create an array of cards:card [] cardDeck = new card[81];You have to initialize each array element with an instance of card.
ProggerFromKupfera at 2007-7-9 20:49:47 > top of Java-index,Java Essentials,Java Programming...
# 3
thank you, i figured it out...:D
dets00ba at 2007-7-9 20:49:47 > top of Java-index,Java Essentials,Java Programming...