“spécificateur de format en java” Réponses codées

spécificateur de format en java

        int input = 42;
        System.out.print("Prefixed with necessary zeroes to make output length a total of 8 characters, including the positive sign: " + String.format("%+08d\n", input)); // This will print +0000042 
        System.out.print("Octal output: " + String.format("%o\n", input)); // This will print 52
        System.out.print("Hex output: " + String.format("%x\n", input)); // This will print 2a
CompSciGeek

Formatage de sortie Java

// Here is an example from https://docs.oracle.com/javase/tutorial/java/data/numberformat.html

System.out.format("The value of " + "the float variable is " +
     "%f, while the value of the " + "integer variable is %d, " +
     "and the string is %s", floatVar, intVar, stringVar); 
CompSciGeek

Réponses similaires à “spécificateur de format en java”

Questions similaires à “spécificateur de format en java”

Plus de réponses similaires à “spécificateur de format en java” dans Java

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code