Write out in comments next to each output which statement


Create two strings using the following syntax:
String s1=new String("waddup");
String s2=new String("waddup");
Write the code for the following statements:
Check whether string1 is equal to string2 using the Boolean operator == and assign the result to a Boolean variable isEqual.
Output isEqual
Check whether string1 is equal to string2 using the .equals method, ignoring case, and assign the result to a Boolean variable isEqual.
Output isEqual
Compare string1 with string2 and assign the result to an int variable bino.
Output bino
Compare string1 with string2, ignoring case, and assign the result to an int variable bino.
Output bino
Check whether the string1 has the prefix âwasâ and whether string2 has the suffix âdupâ, assign the value to a Boolean variable pns
Output pns
Assign the length of string1 to an int variable x.
Output x
Assign the first character of string1 to a char variable x.
Output x
Create a new string string3 that combines string1 with string2.
Output string3
Create a substring of string1 starting from index 1.
Output the result
Create a substring of string1 from index 1 to index 4.
Output the result
Create a new string string3 that converts string1 to lowercase.
Output the result
Create a new string string3 that converts string1 to uppercase.
Output the result
Write out in comments next to each output which statement the code corresponds to. For example: System.out.println(isEqual); //requirement 1 Create a screenshot of your console output.


Your submission should include:
1) The java source code file
2) Screenshot of the console output
3) Comments numbering the tasks in your code

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write out in comments next to each output which statement
Reference No:- TGS02381590

Now Priced at $20 (50% Discount)

Recommended (98%)

Rated (4.3/5)