3 - String Basics

Get an introduction to or review of basic string operations in Java Programming.

Code HuntJava
1.0x

3 - String Basics

Created 3 years ago

Duration 0:03:09
lesson view count 7
Get an introduction to or review of basic string operations in Java Programming.
Select the file type you wish to download
Slide Content
Tags: Code Hunt Java
  1. Working with Strings

    Slide 2 - Working with Strings

  2. The String Type

    Slide 3 - The String Type

    • A String is a sequence of characters, delimited by double quotes:
    • "abc"
    • "Java"
    • "java"
    • "hamburger"
    • Strings can contain non-alphabetic characters:
    • "hot dog"
    • "Hello, world!"
    • "Number 1"
    • ""
  3. String Length

    Slide 4 - String Length

    • The number of characters in a String can be found using the length() method:
    • System.out.println("abcde".length());
    • System.out.println("Java is cool".length());
    • System.out.println("Hello, world!".length());
    • System.out.println(" /// ".length());
  4. String Concatenation

    Slide 5 - String Concatenation

    • When two Strings are stuck together, it is called concatenation.
    • Strings are concatenated using the + operator:
    • "abc" + "def"
    • "Go go " + "Gadget!"
    • "A man, " + "a plan, " + "a canal: " + "Panama!"
  5. Check Your Understanding

    Slide 6 - Check Your Understanding

  6. Check Your Understanding

    Slide 7 - Check Your Understanding

  7. Check Your Understanding

    Slide 8 - Check Your Understanding