mardi 24 décembre 2019

Why does this give unexpected return value?

the same code when solving problems on codingbat works , but not in my IDE

public class Bark {
public static void main(String[] args) {
    String lo = "hi there";
    String shank = lo.substring(0 , 2);
    if (shank.equals("hi")) return true;
    else return false;
}}

Aucun commentaire:

Enregistrer un commentaire