Static method cannot make new objects?
I have this line of code in my deck class..
Code:
public static void createDeckBlackJack(){
Card[] deck1 = new Card[24];
String suit = "";
int count = 0;
int n = 0;
while (count < 2){
switch(count){
case 0:
suit = "Hearts";
case 1:
suit = "Diamonds";
case 2:
suit = "Clubs";
case 3:
suit = "Spades";
}
deck1[0 + n] = new Card(2, "2", suit, 0);
deck1[1 + n] = new Card(3, "3", suit, 0);
deck1[2 + n] = new Card(4, "4", suit, 0);
deck1[3 + n] = new Card(5, "5", suit, 0);
deck1[4 + n] = new Card(6, "6", suit, 0);
deck1[5 + n] = new Card(7, "7", suit, 0);
deck1[6 + n] = new Card(8, "8", suit, 0);
deck1[7 + n] = new Card(9, "9", suit, 0);
deck1[8 + n] = new Card(10, "Jack", suit, 0);
deck1[9 + n] = new Card(10, "Queen", suit, 0);
deck1[10 + n] = new Card(2, "King", suit, 0);
deck1[11 + n] = new Card(11, "Ace", suit, 1);
n += 12;
count++;
}
}
I have another class that has my "main" in it. I put createDeckBlackJack();, and then tried to type deck1. in eclipse.. No options.. just a red underline.. Why is it not recognizing this object that was created by the method?