On 09 Jan 2012, at 00:12, leledumbo wrote:

> Since the title is still valid, I'd like ask about the usage of java
> collections in generic style. For instance java.util.ArrayList. How can I
> construct JUArrayList with Integer constraint as in Java?
> 
> e.g.: ArrayList<Integer> a = new ArrayList<Integer>;

Java-style generics are a Java-language-level feature (they work via 
type-erasure at the language level) that does not exist in FPC. The FPC JVM 
port enables compiling Pascal code into Java bytecode. It does not add Java 
language features to the Object Pascal language (except to the extent required 
for interoperability with Java bytecode).

You simply have to use them like in the Java language before JDK 1.5: by 
typecasting the return values (which are JLObject) into JLInteger.


Jonas_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to