PlusTest - public static void main (String args) {...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
// ******************************************************************* // PlusTest.java // // Demonstrate the different behaviors of the + operator // ******************************************************************* public class PlusTest { // ------------------------------------------------- // main prints some expressions using the + operator // -------------------------------------------------
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: public static void main (String args) { System.out.println ("This is a long string that is the " + "concatenation of two shorter strings."); System.out.println ("The first computer was invented about " + 55 + " years ago."); System.out.println ("8 plus 5 is " + 8 + 5); System.out.println ("8 plus 5 is " + (8 + 5)); System.out.println (8 + 5 + " equals 8 plus 5."); } }...
View Full Document

Ask a homework question - tutors are online