Write a main method which does the following and then consider
the output and how this is a result of aliasing and how String
is immutable and StringBuffer is mutable. It creates:
- a String reference strOne that refers to a String that contains "Hello"
- a String reference strTwo that refers to the same object as strOne refers to
- a StringBuffer reference sbOne that refers to a StringBuffer that contains "Hello"
- a StringBuffer reference sbTwo that refers to the same object as sbOne refers to
then
- uses the += operator to append "There" to strOne
- uses the append method to append "There" to sbOne
- prints strOne, strTwo, sbOne, sbTwo