Menu
Question Index
...

Write a program to remove the duplicate strings in an array.

Input (String Array) Output (String Array)
{C, C++, Java, .NET, HTML, Java, CSS, XML, HTML} {C, C++, Java, .NET, HTML, CSS, XML}
{CSE, ECE, EEE, IT, ECE, CSE, MEC, CIVIL} {CSE, ECE, EEE, IT, MEC, CIVIL}
{} {}
null null



class RemoveDuplicateStringsInArray
{
    public static void main(String s[])
    {
        String branches[] = {"CSE", "ECE", "IT", "MEC", "CSE", "ECE", "EEE", "CIVIL"};
        String[] outputArray = removeDuplicateStringsInAnArray(branches);
        System.out.println("The strings in array after removing the duplicates are ");
        for(String outputString : outputArray){
            System.out.print(outputString + ", ");
        }

    }


    public static String[] removeDuplicateStringsInAnArray(String[] array)
    {
        String[] result = null;
        return result;
    }
    public static int getArraySizeWithoutDuplicates(String[] array)
    {
        int result = 0;
        return result;
    }

}

Doubts

Problems

Topic: Java String Arrays - String Arrays In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App