So I have been writing a game and was looking to make the code base more useable. I originally wrote the following code once and worked fine. But for reuse and fewer lines, I was adjusting it. Now it's not working
Main java file:
builder.setStats("p, divine,0,1,2,2,1,2,4");
Builder file:
String [] holder = new String[8];
public void setStats(String sentstats){
holder = sentstats.split(",",8)
if(holder[0]== "p"){
charsheet.style = holder[1];
}
}
So the issue is the if never does the proper response. I know I have full access to all associated files as I have tested for that. And I know I could get it to work other ways. But to reduce redundancy. And make parts of the code recursive I have done it like this.