PrintfExamples.java Source code

Java tutorial

Introduction

Here is the source code for PrintfExamples.java

Source

public class PrintfExamples {
    public static void main(String[] args) {

        System.out.printf("num is %s\n", 5);
        System.out.printf("char is %s\n", 'a');
        System.out.printf("char is %S\n", 'a');
        System.out.printf("bool is %s\n", true);

    }

}
/*
num is 5
char is a
char is A
bool is true
    
*/