The java.util.Arrays provide convenient way to create a fixed-size list initialized to contain several elements:
public static <T> List<T> asList(T... a) { return new ArrayList<T>(a); } /** * @serial include */ private static class ArrayList<E> extends AbstractList<E> implements RandomAccess, java.io.Serializable { private static final long serialVersionUID = -2764017481108945198L; private final E[] a; ArrayList(E[] array) { if (array==null) throw new NullPointerException(); a = array; } public int size() { return a.length; } public Object[] toArray() { return a.clone(); } public <T> T[] toArray(T[] a) { int size = size(); if (a.length < size) return Arrays.copyOf(this.a, size, (Class<? extends T[]>) a.getClass()); System.arraycopy(this.a, 0, a, 0, size); if (a.length > size) a[size] = null; return a; } public E get(int index) { return a[index]; } public E set(int index, E element) { E oldValue = a[index]; a[index] = element; return oldValue; } public int indexOf(Object o) { if (o==null) { for (int i=0; i<a.length; i++) if (a[i]==null) return i; } else { for (int i=0; i<a.length; i++) if (o.equals(a[i])) return i; } return -1; } public boolean contains(Object o) { return indexOf(o) != -1; } }
List list = Arrays.asList("Larry", "Moe", "Curly");
It seems we get the the instance of ArrayList which inherits AbstractList. But it dones't override the method of add, remove..., etc. As a result, below code will throw exception
public static void main(String[] args) { List list = Arrays.asList("Larry", "Moe", "Curly"); /// list.add("Peter"); list.remove(0); }The result is:
Exception in thread "main" java.lang.UnsupportedOperationException at java.util.AbstractList.remove(AbstractList.java:144) at ArraysTest.main(ArraysTest.java:11)By looking at the source code you will find the cause
相关推荐
Trap+Instrumental.lnk
SnmpTrap工具的用法,有比较详细的用法说明哦
为使用SNMP定义Trap的惯例 (RFC1215 A Convention for Defining Traps for use with the SNMP) 本备忘录的状态: 本备忘录建议了一种利用SNMP定义陷阱的正面的方法。读者应该 注意到在internet标准网络管理框架...
SNMP简单网络管理协议,其中其支持的一个命令snmptrap命令,用于模拟向管理机发送trap消息。
LEON 2 SystemC model on ReSP, 21页,目录如下: 1 Leon 2 5 1.1 Introduction . . . . . . . ....1.2 Architecture Description ....2.5 Modication of RTEMS to enable interrupts trap handler . . . . 20
It approaches bioinformatics from a unique perspective, highlighting interdisciplinary gaps that often trap the unwary.The book considers how the need for biological databases drove the evolution of ...
1 The Business of NAND. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Rahul N. Advani 2 Reliability of 3D NAND Flash Memories. . . . . . . . . . . . . . . . . . . . 29 A. Grossi, C...
6Existence and uniqueness of the MP inverse . . . . . . . . . . . 37viContents 7Some properties of the MP inverse . . . . . . . . . . . . . . . . 38 8Further properties . . . . . . . . . . . . . . . ....
WINDOWS下SNMP TRAP接收调试软件,可显示TRAP信息列表和TRAP信息的编码内容,非常适合嵌入式SNMP协议开发者使用。
Snmp_trap的配置与使用.docSnmp_trap的配置与使用.docSnmp_trap的配置与使用.doc
Most SNMP traps sent to trap.coldstart.io will arrive on your phone within 500ms, with a crowd sourced human readable version of the OIDs in a manner similar to SNMPTT. Read more here: ...
与Siri师出同门:个性化网络发现引擎Trapit.docx
"When you have learned to snatch the error code from the trap frame, it will be time for you to leave." “当你从我手中夺走水晶球时,就是你离开的时候了。” 1.1 Something mysterious is formed, born ...
集合了 所有的 Unix命令大全 ...telnet 192.168.0.23 自己帐号 sd08077-you0 ftp工具 192.168.0.202 tools-toolss ... 各个 shell 可互相切换 ksh:$ sh:$ csh:guangzhou% bash:bash-3.00$ ... 命令和参数之间必需用空格隔...
Describes the architecture, registers, and primary functions of the TMS320C28x CPU. 2.1 CPU Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....
Embed or host user-supplied content without running into the trap of content sniffing For quick reference, "Security Engineering Cheat Sheets" at the end of each chapter offer ready solutions to ...
通过抓包实验学习SNMP-Trap.pdf
Study of the aerodynamic trap for containerless laser materials processing in microgravity
windows平台下,用于接收snmp协议的trap消息的小软件,可以测试你编写的trap命令是否发送成功了
SNMP Trap 接收工具,可以在windows 10 上运行,亲测可用,不需要安装dll,打开即可用。