Question: String sentence = I am learning how to use String object methods.; String space = ; int num1 = 12; double num2 = 26.2;
String sentence = "I am learning how to use String object methods."; String space = " "; int num1 = 12; double num2 = 26.2; /* a. Use length() method to get the number of characters in the variable, sentence. */ int sentenceLength = "Replace this text with your answer."
/* b. Use the toUpperCase() method to generate an all caps version of the string in the variable sentence. */ String capsSentence = "Replace this text with your answer."
/* c. Use the toLowerCase() method to generate an all lower case version of the string in the variable sentence. */ String lowerSentence = "Replace this text with your answer."
/* d. Concatenate the variables num1, sentence, and num2, putting a space between each in the output string. */ String newString = "Replace this text with your answer."
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
