Question
Type in and run the following program and submit program? (9 points). Then answer the following questions (3 points for each sub question) (total 30
Type in and run the following program and submit program? (9 points). Then answer the following questions (3 points for each sub question) (total 30 points).
a. What is in line 5? How is it used in the program?
b. What is in line 6? How is it used in the program?
c. Explain line 8. What is String, testString, =, This is a Test
d. Explain line 9. What is testString , toLowerCase();
e. Explain line 12. What is the outcome?
f. Explain line 13. What is the outcome?
g. Explain the difference between line 16 and line 17?
public static void main(String[] args) {
int length;
String newTestString;
String testString = "This is a Test";
String bigTestString = testString.toUpperCase();
String smallTestString = testString.toLowerCase();
newTestString = bigTestString + smallTestString;
length = testString.length();
System.out.println(testString);
System.out.println("String in uppercase: "+ bigTestString);
System.out.println("String in lowecase: "+ testString.toLowerCase());
System.out.println("NewTestString is: " + newTestString);
System.out.println("Length of String is: " + length);
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started