خرید بک لینک

Vote count: 0

Hello I need to find the line numbers at which the longest word in a file appears. If there are two or more different words of the same longest length, then track the first one only. I have done the tracking of the longest word but I need help finding what lines the longest word is in. This is my code that finds the longest word:

        while(scan2.hasNextLine()){
            String line = scan2.nextLine();
            if(line.contains(longestWord)){
                longestWordList.add(longestWord);
            }
            else{
                longestWordList.add(null);
            }
        }

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 19 فروردين 1395 ساعت: 9:07

صفحه بندی