David 4 лет назад
Родитель
Сommit
1dd6705d0f
2 измененных файлов: 20 добавлений и 0 удалений
  1. +6
    -0
      .idea/vcs.xml
  2. +14
    -0
      src/HUE_06_Generics.java

+ 6
- 0
.idea/vcs.xml Просмотреть файл

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

+ 14
- 0
src/HUE_06_Generics.java Просмотреть файл

@@ -1,5 +1,19 @@
import java.util.Queue;

public class HUE_06_Generics {
public static void main(String[] args) {
Queue<String> strs = new ChainQueue<String>();
strs.add("hallo1");
strs.add("hallo2");
strs.add("hallo3");
System.out.println("Contains: " + strs.contains("hallo1"));
System.out.println("Contains: " + strs.contains("hallo4"));
System.out.println(" - " + strs.poll() + " #" + strs.size());
System.out.println("Contains: " + strs.contains("hallo1"));
System.out.println("Contains: " + strs.contains("hallo4"));
System.out.println(" - " + strs.poll() + " #" + strs.size());
System.out.println(" - " + strs.poll() + " #" + strs.size());
System.out.println(" - " + strs.poll() + " #" + strs.size());

}
}

Загрузка…
Отмена
Сохранить