Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132938 views
License: OTHER
1
LinkedList<MyType> myList = new LinkedList<MyType>();
2
List<MyType> myList = new LinkedList<MyType>();
3
import java.util.List;
4
5
Animal a = new Animal();
6
// The compiler can resolve this method call statically:
7
a.Roar();
8
9
public void MakeSomeNoise(object a) {
10
// Things happen...
11
// You won't know if this works until runtime:
12
((Animal) a).Roar();
13
}
14
15
for (Map.Entry<Person, TelephoneNumber>
16
entry : phonebook.entrySet()) {
17
Person k = entry.getKey();
18
TelephoneNumber v = entry.getValue();
19
System.out.println(k + " " + v);
20
}
21
22