代码搜索:Generics
找到约 1,477 项符合「Generics」的源代码
代码结果 1,477
www.eeworm.com/read/389293/8535548
java arrayofgenerics.java
//: arrays/ArrayOfGenerics.java
// It is possible to create arrays of generics.
import java.util.*;
public class ArrayOfGenerics {
@SuppressWarnings("unchecked")
public static void main(Str
www.eeworm.com/read/373369/9460131
java arrayofgenerics.java
//: arrays/ArrayOfGenerics.java
// It is possible to create arrays of generics.
import java.util.*;
public class ArrayOfGenerics {
@SuppressWarnings("unchecked")
public static void main(Str
www.eeworm.com/read/373369/9461076
java multipleinterfacevariants.java
//: generics/MultipleInterfaceVariants.java
// {CompileTimeError} (Won't compile)
interface Payable {}
class Employee implements Payable {}
class Hourly extends Employee
implem
www.eeworm.com/read/373369/9461079
java simpleholder.java
//: generics/SimpleHolder.java
public class SimpleHolder {
private Object obj;
public void set(Object obj) { this.obj = obj; }
public Object get() { return obj; }
public static void mai
www.eeworm.com/read/373369/9461089
java coffee.java
//: generics/coffee/Coffee.java
package generics.coffee;
public class Coffee {
private static long counter = 0;
private final long id = counter++;
public String toString() {
return g
www.eeworm.com/read/373369/9461099
cpp instantiategenerictype.cpp
//: generics/InstantiateGenericType.cpp
// C++, not Java!
template class Foo {
T x; // Create a field of type T
T* y; // Pointer to T
public:
// Initialize the pointer:
Foo()
www.eeworm.com/read/373369/9461103
java basicgeneratordemo.java
//: generics/BasicGeneratorDemo.java
import net.mindview.util.*;
public class BasicGeneratorDemo {
public static void main(String[] args) {
Generator gen =
BasicGener
www.eeworm.com/read/373369/9461107
java selfboundingandcovariantarguments.java
//: generics/SelfBoundingAndCovariantArguments.java
interface SelfBoundSetter {
void set(T arg);
}
interface Setter extends SelfBoundSetter {}
public
www.eeworm.com/read/373369/9461131
java limitsofinference.java
//: generics/LimitsOfInference.java
import typeinfo.pets.*;
import java.util.*;
public class LimitsOfInference {
static void
f(Map