Skip to content

Commit 2e4c454

Browse files
committed
interface List e classe LinkedList
1 parent 44caac3 commit 2e4c454

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package module4.equals.lists;
2+
3+
import java.util.LinkedList;
4+
import java.util.List;
5+
6+
public class TesteLinkedList {
7+
8+
public static void main(String[] args) {
9+
10+
List<String> lista = new LinkedList<>();
11+
12+
String nome = new String("emanoel");
13+
lista.add(nome);
14+
15+
String sobrenome = new String("campos");
16+
lista.add(sobrenome);
17+
18+
String nomeIgual = new String("emanoel");
19+
20+
boolean igual = nome.equals(sobrenome);
21+
System.out.println(igual);
22+
23+
boolean existe = lista.contains(nomeIgual);
24+
System.out.println(existe);
25+
26+
for (String nomes : lista) {
27+
System.out.println(nomes);
28+
}
29+
}
30+
}

0 commit comments

Comments
 (0)