ITEC 1620 Lecture 19: 1620_lecture_19_slides
Document Summary
Text primitive is char a single character. Useful text (e. g. words) are multiple characters. Useful manipulations: substring(), touppercase(), substring(), touppercase(), replace(), etc. Three important (primitive) operations exist i t. Anything inside double quotes is a string literal. String literals appear as a primitive datatypeyp. String literals are not normal java syntax hides that an object is created. Normal java syntax char[] text = new char[] { h", e", l", l", o"}; Primitive datatypes can be converted into strings through concatenation. Yes if strings are primitive datatypes. No if strings are normal objects t if st i l bj. To make first == second true, java makes the identifiers refer to the same object first second. What happens if second is changed? second. touppercase(); pp. If the string referred to by second is changed then the string referred to by changed, then the string referred to by first will also change. The independent declarations do not imply this cannot let it happen.