Hi guys can u tell until tomorrow ??
Well, I dont use java.util.iterator to create my iterator interface, just create my own so
I have 2 Iterators: AccountIterator / FileIterator, _Stack Overflow中文网
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
I have 2 Iterators: AccountIterator / FileIterator,
你已经用 type 参数化了你的类E,但是你的 account 数组是 type Account。accounts[index]返回一个Account而不是E。
E
Account
accounts[index]
您可能打算实现一个Iterator<Account>. 将类签名更改为此...
Iterator<Account>
public class AccountIterator<E> implements Iterator<Account>
然后,Impl 将处理您的通用偏好,并且它会起作用。
class MyIter implements Iterator<String> { String [] arr = new String[10]; public void init() { } public boolean hasNext() { return false; } public String next() { return arr[1]; } }
只需修改类头以指定对象类型。
利用
public class AccountIterator implements Iterator<Account>
而不是一般的
public class AccountIterator<E> implements Iterator<E>
您必须将 E 更改为 Account。
我在将空值传递给存储过程时遇到问题,例如,如果未在下拉列表中选择一个选项,如何将其作为空值通过 sqdatasource 传递到数据库。
我目前在我的页面上有许多下拉控件,它们保存参数值以传递给存储过程。
当我从这些控件中选择一些值时,gridvie