0 0
Read Time:20 Second

Write a program to check if the letter ‘e’ is present in the word ‘Umbrella’

public class CheckLetterExample {
  public static void main(String[] args) {
    String word = "Umbrella";
    boolean containsE = word.contains("e");
    if (containsE) {
      System.out.println("The word " + word + " contains the letter 'e'");
    } else {
      System.out.println("The word " + word + " does not contain the letter 'e'");
    }
  }
}

Output:

The word Umbrella contains the letter 'e'
Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

Leave a Comment