String Concatenation (operator overloading)
4
String Concatenation (operator overloading) 3.0
-
Upload
dieter-santana -
Category
Documents
-
view
25 -
download
1
description
String Concatenation (operator overloading). 3.0. overloading. String concatenation. 4 + 5 9 "wind" + "ow" "window" "Result: " + 6 "Result: 6" "# " + price + " cents" "# 500 cents". Quiz. System.out.println(5 + 6 + "hello"); System.out.println("hello" + 5 + 6);. 11hello. - PowerPoint PPT Presentation
Transcript of String Concatenation (operator overloading)
String Concatenation(operator overloading)
3.0
Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling
String concatenation
• 4 + 5═ 99
• "wind" + "ow"═ "window""window"
• "Result: " + 6═ "Result: 6""Result: 6"
• "# " + price + " cents"═ "# 500 cents""# 500 cents"
overloading
Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling
Quiz
• System.out.println(5 + 6 + "hello");
• System.out.println("hello" + 5 + 6);
11hello11hello
hello56hello56