上一页 1 ··· 4 5 6 7 8 9 10 11 12 13 下一页
摘要: 由于泛型类型在运行时被消除,因此,对于如何使用泛型类型是有一些限制的。 限制1:不能使用new E() 不能使用泛型类型参数创建实例。例如,下面的语句是错误的: E object = new E(); 出错的原因是运行时执行的是new E(),但是运行时泛型类型E是不可用的。 限制2:不能使用new 阅读全文
posted @ 2015-12-21 17:08 第壹时间 阅读(2364) 评论(1) 推荐(2) 编辑
摘要: Java泛型中的标记符含义:E- Element (在集合中使用,因为集合中存放的是元素)T- Type(Java 类)K- Key(键)V- Value(值)N- Number(数值类型)?- 表示不确定的java类型S、U、V- 2nd、3rd、4th typesObject跟这些标记符代表的j... 阅读全文
posted @ 2015-12-20 11:19 第壹时间 阅读(3119) 评论(0) 推荐(1) 编辑
摘要: // Finite +-0.0 System.out.println("Finite with +-0.0:"); System.out.println("Finite / +-0.0: " + 8.0 / 0.0); System.out.println("Finite / +-0.0: "... 阅读全文
posted @ 2015-12-20 08:33 第壹时间 阅读(294) 评论(0) 推荐(0) 编辑
摘要: 1、相同目录下 指定applet类名称,applet的宽度和高度。 2、不同路目下 添加指定applet所在目录。在浏览器中查看,或使用applet查看器工具查看(appletviewer*.class); 阅读全文
posted @ 2015-12-10 09:44 第壹时间 阅读(306) 评论(0) 推荐(0) 编辑
摘要: 1、在正常情况下windowClosed方法不执行;2、调用dispose方法,windowClosed方法会执行。例如:在windowClosing方法中执行dispose方法,windowClosed方法执行;3、在windowClosing方法中执行dispose方法,如果使用了frame.s... 阅读全文
posted @ 2015-12-08 18:52 第壹时间 阅读(652) 评论(0) 推荐(0) 编辑
摘要: import java.math.BigInteger;public class Rational extends Number implements Comparable { private BigInteger numerator;// 分子 private BigInteger denomin... 阅读全文
posted @ 2015-12-06 17:37 第壹时间 阅读(870) 评论(0) 推荐(0) 编辑
摘要: public class Rational extends Number implements Comparable { private long numerator;// 分子 private long denominator;// 分母 /** * @param args */ public... 阅读全文
posted @ 2015-12-06 17:36 第壹时间 阅读(774) 评论(0) 推荐(0) 编辑
摘要: 1、BigInteger(byte[] val)这个构造函数用于转换一个字节数组包含BigInteger的二进制补码,以二进制表示成一个BigInteger。(用字节数组中值的ASCII码构造BigInteger)2、BigInteger(int signum, byte[] magnitude)此... 阅读全文
posted @ 2015-12-06 17:34 第壹时间 阅读(5222) 评论(0) 推荐(1) 编辑
摘要: public static int gcd(int a, int b) { int n1 = Math.abs(a); int n2 = Math.abs(b); int remainder = n1 % n2; while (remainder > 0) { n1 = n2; n2 ... 阅读全文
posted @ 2015-12-06 10:23 第壹时间 阅读(218) 评论(0) 推荐(0) 编辑
摘要: public static int hexToDecimal(String hex) { int decimalValue = 0; for (int i = 0; i = 'A') { return 10 + ch - 'A'; } else { return ch - '0'; ... 阅读全文
posted @ 2015-11-24 19:59 第壹时间 阅读(513) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 13 下一页