vendredi 9 septembre 2016

Issue with returning a char

I don't understand why I am getting an error stating that the method getClassification must return a result of type char.

private char A, B, C, D;

public char getClassification() {
    if(parts[0] >= 0 && parts[0] <= 127)
        return (A);
    else if(parts[0] >= 128 && parts[0] <= 191)
        return (B);
    else if(parts[0] >= 192 && parts[0] <= 223)
        return (C);
    else if(parts[0] >= 224 && parts[0] <= 255)
        return (D);
}

Aucun commentaire:

Enregistrer un commentaire