Menu
Question Index
...

Write a program to check the given two strings are equals or not, with the help of intern method.

Input (String, String) Output (Boolean)
'java', new String('java') true
'HYDERABAD', 'HYDERABAD' true
'Java School', new String('JavaSchool') false
'MeritCampus', new String('MeritCampus') true
'Vijayawada', new String('HYDERABAD') false



class ComparingStringsWithIntern
{
    public static void main(String s[])
    {
        String firstString = "java";
        String secondString = new String("java");
        System.out.println("Both Strings are equals : " + areEquals(firstString, secondString));

    }


    public static boolean areEquals(String firstString, String secondString) {
    }

}

Doubts

Problems

Topic: Unknown

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App