Ir para conteúdo

zFork

Membros
  • Total de itens

    3
  • Registro em

  • Última visita

Respostas na Comunidade

  1. zFork's postagem in [Resolvido] Argumentos com números was marked as the answer   
    Primeiramente, tem que verificar se é um número, utilize este método:
    public boolean isNum(String string){ try{ Integer.parseInt(string); return true; }catch(Exception e){return false;} } Depois verifique se o argumento é inteiro, se for, faça a multiplicação.
    if(isNum(args[0])){ int numero = Integer.parseInt(args[0])*20; }
×
×
  • Criar Novo...