
class StringUsage
{
  public static void main(String [] args)
  {
    //Strings are a reference type, but can create it as though it's primitive
    String myWords = "Michigan";

    //optionally, make a String as any other reference type
    String aSentence;
    aSentence = new String("Wisconsin");

    //substring, length, indexOf
    //YOU DON'T NEED TO MEMORIZE THESE
    String firstWord = aSentence.substring(0, 4); 

    System.out.println("Length of <" + aSentence + ">: " + aSentence.length());

    //show index of the word Michigan(this will print zero)
    System.out.println("The index of Michigan is: " + myWords.indexOf("Michigan"));

    //remember string "addition" is called "concatenation"
    
  }
}

