Question Index

Write a program to check whether the given sentence has same sized words.

Input (String) Output (Boolean)
I don't need your attitude, I have one of my own false
Hai, how are you true
Avoid using verbs. true
Never try to drown your troubles. Especially if he can swim. false

class SameSizedWords
    public static void main(String s[])
        String inputSentence = "It's impossible to be angry at someone who makes you laugh.";
        System.out.println("Is equally spaced sentence : " + hasSameSizedWords(inputSentence));;


    public static boolean hasSameSizedWords(String inputSentence) {




Topic: Additional String Methods in Java

Read this topic
Take test on this topic

Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App