Write a sample Java program to say hello Fall 2018 that demonstrates println and
ID: 3745738 • Letter: W
Question
Write a sample Java program to say hello Fall 2018 that demonstrates println and printf functions. Demonstrate the use of formats in printf and the use of string concatenation in java. Your program should use multiple features of these functions and be unique. Write a sample Java program to say hello Fall 2018 that demonstrates println and printf functions. Demonstrate the use of formats in printf and the use of string concatenation in java. Your program should use multiple features of these functions and be unique.Explanation / Answer
public class SayHello { public static void main(String[] args) { // normal println System.out.println("hello Fall 2018"); // printf with %d format specifier for int System.out.printf("hello Fall %d ", 2018); // printf with %d format specifier for string System.out.printf("hello %s 2018 ", "Fall"); // string concatenation System.out.println("hello " + "Fall " + 2018); } }
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.