Menu
Question Index
...

Write a program to check if the word can be formed with letters of the other word.

Input (String, String) Output (boolean)
potato, pot true
potato, tattoo true
potato, tea false
India, Idea false
India, dandia true



class CanWordBeFormedWithLetters
{
    public static void main(String s[])
    {
        String originalWord = "potato";
        System.out.println("The word 'too' is present : " + canFormWord(originalWord, "too"));

    }


    public static boolean canFormWord(String originalWord, String formedWord) {
    }

}

Doubts

Problems

Topic: Java Searching Strings - Java indexOf, lastIndexOf Methods

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App