mardi 15 décembre 2015

Java- Can I call methods in an if statement header?

 public static boolean know(String [] [] t, int r , int c, String 
{            
        boolean yolo = false;                                                       
        if ((t[r-1][c-1]).equals(x+"_"));
            yolo = true;
        return yolo; 
}

the above code is the method I'm trying to call. can i call it with the call statement, shown below, which is in an if statement header. By the way, the if statement bottom code is in another method not shown.

if (know(t,1,2,"X"))
            return 3;

Aucun commentaire:

Enregistrer un commentaire