About ArrayList...

I got this simple code:

private ArrayList<Logic> logic =new ArrayList<ILogic>();

public Logic getLogic(int pos)

if( logic.get(pos) !=null );// error here*

return logic.get(pos)

* if the position do not existis, i can't get thelogic in that position to check if its null...

Question: How can i check iflogic in positionpos is null?

[678 byte] By [wellingtona] at [2007-11-27 4:06:14]
# 1
if (pos >= logic.size()) return null;
calvino_inda at 2007-7-12 9:11:19 > top of Java-index,Java Essentials,Java Programming...
# 2
Why donot u remove the semicolon which is at the end of if statement.Once u have done that make sure that u complete the return statement by placing a semicolon at the end.This should fix your problem.
Harmindera at 2007-7-12 9:11:19 > top of Java-index,Java Essentials,Java Programming...