(Display five messages) Write a program that displays Welcome to Java five times
belongs to book: Introduction to Java Programming, Comprehensive Version (10th Edition)|Y. Danial liang|10th edition| Chapter number:1| Question number:2
All Answers
need an explanation for this answer? contact us directly to get an explanation for this answer
// (Display five messages) Write a program that displays Welcome to Java five times.
public class Exercise_01_02 {
public static void main(String[] args) {
System.out.println("Welcome to Java.");
System.out.println("Welcome to Java.");
System.out.println("Welcome to Java.");
System.out.println("Welcome to Java.");
System.out.println("Welcome to Java.");
}
}
need an explanation for this answer? contact us directly to get an explanation for this answer
total answers (2)
// (Display five messages) Write a program that displays Welcome to Java five times.
public class Exercise_01_02 {
public static void main(String[] args)
for(int i=1;i<=5;i++){
System.out.println("Welcome to Java");
}
}
}