Hello guys,
So I decided to experiment with what I know.
Start out with a small program then build on it till I used everything I know, with out making any mess.
I came up with an idea of a program that will tell me who's birthday it is and how many days are left for the other peoples birthdays (I used 7 people).
Output:class BirthdaySurprise { public static void main(String[] args){ // here are all the people byte TSE = 122; short LA = 184; short ZE = 195; short AB = 199; int DE = 234; int HA = 349; int AL = 361; //That's the last one. The numbers are the number of the day that //each person's birthday comes on. So if your birthday comes on Jan 1 //your variable will be equal to 1, and if on Dec31 it will be equal to 365. for( byte aryOneAdder = 1; aryOneAdder <121;){ //Now what I want to happen here is the for loop increments aryOneAdder //till it's equal too 121. And store all the numbers in the aryOne array aryOneAdder++; byte[] aryOne = new byte[aryOneAdder]; System.out.println(aryOne[0]); } } }
run:
0
0
0
0
0
0
0
0
0
0
0( 121 zero's in all )
What went wrong in that loop?
Oh and the aryOne array is made in the for loop, that means I wont be able to use it out of the loop right?