@DavidMarciel the code is now supposed to store the received value in the corresponding variable after checking that some condition is true, but when the program doesn't enter the body of if-condition even though the condition is true. I put an example in this code for the "male" variable being true, and placed a print statement inside the body of the if to show it. Below is my code.
public class j {
static String sss = "male,O+,45,saudi,brain_diseases";
static String male = "";
static String blood = "";
static String age = "";
static String nat = "";
static String dis = "";
static void func() {
String[] pieces = sss.split(",");
male = pieces[0];
blood = pieces[1];
age = pieces[2];
nat = pieces[3];
dis = pieces[4];
System.out.println(male);
System.out.println(blood);
System.out.println(age);
System.out.println(nat);
System.out.println(dis);
//
if(male=="male"){
System.out.println("hello male");
}
}
public static void main(String[] args) {
func();
}}