hello again,
quick question. i know I can check to see if an array as a whole is, or isn't, null:
but how can i check if a particular slot in an array is empty or even exists? for example (this is wrong but gets across what i'm asking):
the error i get is:
What is the proper way to check to see if is [1] even exists?
Thank you,
Shields
by the way, this doesn't really relate to a bigger project. I'm just playing with a simple program to learn more, and get better, with Processing.
quick question. i know I can check to see if an array as a whole is, or isn't, null:
- String[] vals;
- if(vals == null)
- {
- //do something
- }
but how can i check if a particular slot in an array is empty or even exists? for example (this is wrong but gets across what i'm asking):
- String[] vals;
- if(vals[1] == null)//and there is something at [1]
- {
- //do something else
- }
the error i get is:
The operator == is undefined for the argument types(s) int, null
What is the proper way to check to see if is [1] even exists?
Thank you,
Shields
by the way, this doesn't really relate to a bigger project. I'm just playing with a simple program to learn more, and get better, with Processing.
1