How can you use String methods to change the case of a string? Provide an example.
What will be an ideal response?
?The methods toUpperCase() and toLowerCase() convert any String to its uppercase or lowercase equivalent. For example, if you declare a String as String aWord = "something";, then the string "something" is created in memory and its address is assigned to aWord. The statement aWord = aWord.toUpperCase(); creates "SOMETHING" in memory and assigns its address to aWord. Because aWord now refers to "SOMETHING," aWord = aWord.toLowerCase(); alters aWord to refer to "something".
You might also like to view...
When two or more people participate in a heated or hostile interaction in an online forum, this is known as a ________ war
A) viral B) flame C) cyber D) malware
Which of the following is false with regard to pointers to functions?
a) They contain the starting address of the function code. b) They’re dereferenced in order to call the function. c) They can be stored in arrays. d) They cannot be assigned to other function pointers