So I am trying to figure out how to skip an argument if it contains a certain type for instance:
args: Blue 3 Red 7 Green 5 Yellow 2
I am wanting to store the numbers in an array and the colors in a separate array. So if args[i] is a string then store it in the color array and if it is an int store it in the numbers array. Something like if(args[i] == String) then so on and so forth. Obviously that doesn't work though so I was looking for another solution.
public class Main {
public static void main(String[] args)
{
String[] colors = new String[] {};
int[] number = new int[] {};
for(int i = 0; i < args.length; i++)
{
// stuck
}
}
Thanks for the help in advance.