Example2_20

Example2_20 - //Line 6 str = num1 + num2 + "...

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

View Full Document Right Arrow Icon
public class Example2_20 { public static void main(String[] args) { String str; int num1; int num2; num1 = 12; //Line 1 num2 = 26; //Line 2 str = "The sum = " + num1 + num2; //Line 3 System.out.println("Line 4: str: " + str); //Line 4 str = "The sum = " + (num1 + num2); //Line 5 System.out.println("Line 6: str: " + str);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: //Line 6 str = num1 + num2 + " is the sum"; //Line 7 System.out.println("Line 8: str: " + str); //Line 8 str = "The sum of " + num1 + " and " + num2 + " = " + (num1 + num2); //Line 9 System.out.println("Line 10: str: " + str); //Line 10 } }...
View Full Document

Ask a homework question - tutors are online