vendredi 10 août 2018

how to decide data type of an entered element in java [duplicate]

This question already has an answer here:

i want user to enter a int number. or a string by single input statement in java. and print message whether it is string or number. like this.

         if(/*condition*/ )
         System.out.println("is a integer");
         else 
         System.out.println("is a string");

Aucun commentaire:

Enregistrer un commentaire