I\'m a beginner at JAVA and I\'m writing this code that\'s supposed to receive an array of strings and store every string (array element) in the specified variables respectively
There's a much easier way to do what you're trying to do, using String's split() method:
static void func (){
String[] split = sss.split(",");
if (split.length < 5) {
// this means some error in the input, need to handle
}
male=split[0];
blood=split[1];
age=split[2];
nat=split[3];
dis=split[4];
}