I have the class:
import javax.swing.JTextArea;
public class Semantico {
private String tipo;
private String variavel;
public void verificaSem(String stipo, String svariavel, JTextArea txtSemantico){
this.tipo = stipo;
this.variavel = svariavel;
String tipo2 = "int";
if (tipo==tipo2){
txtSemantico.setText(tipo);
}
}
}
This txtSemantico is in my main class, and I would like to write the contents of the variable type that is "int" if it is equal to the content of type2 that is also "int". The point is he does not write. Detail, if I take the If condition and leave what's inside the If, it works. Thank you.