⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 newlist.java

📁 java 泛型的程序
💻 JAVA
字号:
import java.util.*;
class NewList<Double>
{
	//创建新的List集合类型对象list,使其存储内容都Double类型数据
	public List<Double> list = new LinkedList<Double>();
	
	//方法过载:向LinkedList中添加数据
	public void add(Double d)
	{
		list.add(d);
	}
	
	//方法过载:获取LinkedList中index指定位置的数据
	public Double get(int index)
	{
		return list.get(index);
	}
	
	//方法过载:获取Iterator对象
	public Iterator<Double> iterator()
	{
		return list.iterator();
	}
	
	//方法过载:移除LinkedList中index指定位置的数据
	public Double remove(int index)
	{
		return list.remove(index);
	}
	
	//方法过载:设置LinkedList中index指定位置的数据
	public Double set(int index,Double d)
	{
		return list.set(index,d);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -