public class Carta { public String valor; public String palo; public Carta() { } public Carta(String completo) { if (completo.charAt(0) == 'A') this.valor = "1"; else if (completo.charAt(0) == 'T') this.valor = "10"; else if (completo.charAt(0) == 'J') this.valor = "11"; else if (completo.charAt(0) == 'Q') this.valor = "12"; else if (completo.charAt(0) == 'K') this.valor = "13"; else this.valor = String.valueOf(completo.charAt(0)); this.palo = String.valueOf(completo.charAt(1)); } String valorPalo() { if (this.valor.equals("1")) { return "A" + this.palo; } else if (this.valor.equals("10")) { return "T" + this.palo; } else if (this.valor.equals("11")) { return "J" + this.palo; } else if (this.valor.equals("12")) { return "Q" + this.palo; } else if (this.valor.equals("13")) { return "K" + this.palo; } else return this.valor + this.palo; } public int getValorInt() { int aux = Integer.parseInt(this.valor); return aux; } public String getPalo() { return this.palo; } }