Pages

Friday, 1 April 2016

Chapter 1 Exercise 2, Introduction to Java Programming, Tenth Edition Y. Daniel LiangY.

(Display five messages) Write a program that displays Welcome to Java five times.
public class Exercise_02 {

    public static void main(String[] args) {

        for (int i = 0; i < 5; i++) {
            System.out.println("Welcome to Java");
        }
    }
}

No comments:

Post a Comment