Question Index

Write a program to find the words which contains 'me' in a given sentence. Do an ignore case search.

Input (String) Output (List)
Who can come in 3 Cars to our town must be Our hero [come]
I love those random memories that make me smile [memories, me]
Sun rises in the east []
Learn Java with Merit Campus [Merit]

class FindWordsContainingME

{    public static void main(String s[])
        String sentence = "I love those random memories that make me smile";
        System.out.println("The words containing 'ME' are : " + getWordsContainingME(sentence));


public static List<String> getWordsContainingME(String sentence) {
List<String> result = new ArrayList<String>();
//Write a code here to get the words which contains 'me' and add them to result.
return result;



Topic: Java ArrayList

Read this topic
Take test on this topic

Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App