home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-12-14 | 732 b | 30 lines |
- import java.io.*;
-
- /*
- * Stringcat.class prints integers and strings together.
- */
- class Stringcat {
-
- public static void main (String args[]) {
- String today = "";
- int monthday = 15;
-
- /* The string "Today is " and date are concatenated together and
- * assigned to the String today.
- */
- today = "Today is the " + monthday + "th";
-
- /* The String today is printed with println
- */
- System.out.println (today);
-
- /* Here two text strings are concatenated with the integer
- monthday within the println method.
- */
- System.out.println ("Today is the " + monthday +
- " day of the month");
-
- } // end of main ()
- }
-
-