1 3%
2 You
3 Zoo
4 Bull
5 Elite
6 Dark
7 Suits
8 Arrow
9 Happy
10 Bilions
11 What If
12 Osarks
13 Narcos
14 Lúcifer
15 Scream
16 Shooter
17 Friends
18 Vikings
19 Gotham
20 The 100
21 Suburra
22 Cosmos
23 Sintonia
24 Iron Fist
25 Humans
26 Z Nation
27 Perfume
28 Revenge
29 Between
30 El Chapo
31 Sherlock
32 Quântico
33 Bloodline
34 The Rain
35 Punisher
36 Travelers
37 Mr Robot
38 SuperGirl
39 Riverdale
40 Blindspot
41 The Flash
42 Luke Cage
43 Good Girls
44 The Crown
45 Demolidor
46 Homeland
47 Black Sails
48 Death Note
49 The Society
50 Bates Motel
51 Westerwold
52 Van Helsing
53 Constantine
54 Black Mirror
55 The Blacklist
56 Supernatural
57 Prision Break
58 The Last Ship
59 The Returned
60 Breaking Bad
61 The Leftovers
62 Lost in Space
63 Jessica Jones
64 The Defenders
65 Sex Education
66 Peaky Blinders
67 Jane the Virjin
68 Narcos México
69 Os 12 Macacos
70 House of Cards
71 Justice League
72 Altered Carbon
73 Penny Dreadful
74 Rick and morty
75 American Gods
76 The Good Place
77 13 Reasons Why
78 The Mechanism
79 Sons of Anarchy
80 Game of Thrones
81 La casa de Papel
82 Pretty Little Liers
83 Strangers Things
84 American Vandal
85 Everything Sucks
86 Agentes da Shield
87 The Last Kingdom
88 The Walking Dead
89 Designated Survivor
90 America Crime Story
91 The Handmaid’s Tales
92 Everybody’s Hates Cris
93 How I Met Your Mother
94 Fear The Walking Dead
95 The Umbrella Academy
96 Orange is the new Black
97 The Man in the High Castle
98 The End of the Fucking Word
99 How to Get Away with Murder
100 Chilling Adventures of Sabrina
101 The World’s Most Extraordinary Homes
2 curtidas
minhaLista.sort((palavra1, palavra2) -> palavra1.length() - palavra2.length());
1 curtida
Tentei mas não funciona com o Vetor
Consegui
import java.util.*;
public class Array3 {
public static void main(String[] args) {
List<String> listOfString = new ArrayList<String>();
listOfString.add("Agentes da Shield");
listOfString.add("Altered Carbon");
listOfString.add("America Crime Story");
listOfString.add("American Gods");
listOfString.add("American Vandal");
listOfString.add("Anne With an E");
listOfString.add("Arrow");
String[] w = new String[listOfString.size()];
for (int i = 0; i < listOfString.size(); i++) {
w[i] = listOfString.get(i);
}
for (int i = 0; i < w.length; i++) {
for (int j = i + 1; j < w.length; j++) {
String tempi = w[i];
String tempj = w[j];
if (tempj.length() < tempi.length()) {
w[i] = w[j];
w[j] = tempi;
}
}
}
for (int i = 0; i < w.length; i++) {
System.out.println(i+1+" - "+w[i]);
}
}
}
Seu enunciado pede como ordenar uma lista, não um array.
Com um array de String
você pode fazer assim:
Arrays.sort(meuArray, (palavra1, palavra2) -> palavra1.length() - palavra2.length());