Skip to main content
CS Teaching Tips

Main navigation

  • Browse All Tips
  • Tags
  • 3D
  • About
  • Rate Tips
  • Tip Sheets

Have students label a string’s index values to help them understand how to use Java’s substring method.

Share Have students label a string’s index values to help them understand how to use Java’s substring method. with FacebookShare Have students label a string’s index values to help them understand how to use Java’s substring method. with Twitter
  • It is easier for students to choose the correct starting and ending arguments for substring when they have visual reference for characters and indices of the string.
  • The following is an example table containing string character values and index values.
String Values h e l l o
Index Values 0 1 2 3 4

More about this tip

Tags

  • AP A
  • Java
External Source

Leigh Ann Sudol-DeLyser’s notes from 2009 AP CS A exam.

Other Tips By
Other Tips By Leigh Ann Sudol-DeLyser

Similar tips

Use Problets.org to help students practice programming basics in C++, Java, C#, or Visual Basic
Create a physical model of Java objects and references in order to demonstrate situations where multiple references point to the same object in a way that’s easier for students to comprehend.
Tell students they have to believe that some things just work before they will understand why it works because they need exposure to a lot of material before some concepts make sense individually.
  • CSTT Facebook
  • CSTT Twitter

For more information or to report a bug, contact us at admin@csteachingtips.org. Built with Bootstrap. Footer Icons by Mohammed Alyousfi. Powered by Drupal.

Privacy Policy

  • National Science Foundation
  • Sage Fox Group
  • Harvey Mudd College