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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!