In c language,a integer can be printed as follows.
int a=5;
printf("%d",a);
My question is how does these above lines can be written in java.
In c language,a integer can be printed as follows.
int a=5;
printf("%d",a);
My question is how does these above lines can be written in java.
int a=5;
System.out.printf("%d", a);
See Formatting Numeric Print Output: https://docs.oracle.com/javase/tutorial/java/data/numberformat.html