As we know that java is made by the C programming. The java has many common features to C language. While we wants to print in java we usually use the following code.

System.out.println(statement1);
or
System.out.print(statement2);

But there is also the feature of printf in java which we used to do in C programming:

Syntax:

//In C language
printf("format_string", comma_separated_list_of_expressions);

//In JAVA
System.out.printf("format_string", separated_list_of_expressions);

For eg:

 
//In C we use
void main(){
int sum = 4;

printf("The sum is %d , sum);
}

which outputs like this in C :
c-out

But in Java

//In JAVA we use
public class PrintJava {

int sum = 4;

	public void display(){
  		System.out.printf("The value of sum is %d", sum);
  	}

	public static void main (String[] args) {
  		PrintJava test = new PrintJava();
  		test.display();
  }
}

which outputs like this in JAVA :
c-out

Some of the more commonly used conversion symbols in java Print Stream printf() are as follows:
java-print