Find the error(s) in each of the following program segments. Show the corrected statement.
a) System.out.printf("%s\n", 'Happy Birthday' );
b) System.out.printf("%c\n", 'Hello' );
c) System.out.printf("%c\n", "This is a string" );
d) The following statement should print "Bon Voyage" with the double quotes:
System.out.printf(""%s"", "Bon Voyage" );
e) The following statement should print "Today is Friday":
System.out.printf("Today is %s\n", "Monday", "Friday" );
f) System.out.printf('Enter your name: ' );
g) System.out.printf(%f, 123.456 );
h) The following statement should print the current time in the format "hh:mm:ss":
Calendar dateTime = Calendar.getInstance(); System.out.printf("%1$tk:1$%t1:%1$tS\n", dateTime );
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.