- 博客(6)
- 收藏
- 关注
原创 javafx Bind之button和TextField
idNombre.focusedProperty().addListener((observable, oldValue, newValue) -> { idAdd.disableProperty().bind(Bindings.createBooleanBinding(() -> idNombre.getText().trim().isEmpty(), .
2022-05-15 21:58:15 265
原创 Haskell练习笔记
repeated :: Int -> [Int] -> Int repeated y [] = 0 repeated y (x:xs) | y == x = 1+(repeated y xs) | otherwise = repeated y xs Haskell中使用contador 1+funcionconcat' :: [[a]] -> [a] concat' (x:xs) | length xs == 0 =
2021-11-21 23:17:33 105
原创 泛型的总结
1.泛型类可能有多个参数<E1,E2>2.声明构造器的时候不要加尖括号3.实例化后,操作原来泛型位置的结构必须与指定的泛型类型一致(把E,T指定为具体类型)4.泛型类型不同的引用不能相互赋值例如:ArrayList list1 = null;ArrayList list2 = null;list1 = list25.泛型如果不指定,将被擦除,按照Object处理,但不等价于Object6.如果泛型结构是一个接口或抽象类,不能创建对象7.jdk1.7 ArrayList lis
2021-11-01 03:12:15 236
原创 如何自定义泛型结构:泛型类,泛型接口,泛型方法(加个尖括号)
//自定义一个泛型order类public class Order<T> { String orderName; int orederId; //类的内部结构(属性)就可以使用类的泛型 T orderT;public orderT(String orderName,int orderId,T orderT){ this.ordername = ordername; this.orderId = orderId; this.orderT =
2021-10-31 19:39:15 205
原创 为什么要使用泛型
在集合中使用泛型之前的情况用到的方法add(Object o)ArrayList list = new ArrayLIst();//需求:存放学生成绩list.add(78);list.add(97);//问题一:类型不安全list.add(“Tom”);//问题二:强转时,可能出现ClassCastExceptionfor(Object score : list) { int stuScore = (Integer) score; System.out.println(s
2021-10-31 19:05:36 82
原创 泛型在继承方面的体现
类A是类B的父类, G和 G 二者不具备子父类关系。例:LIst list1 = null;List list2 = null;list1 = list2;// error: Inconpatible types//编译不通过补充:类A是类B的父类 A是 B的父类AbstractList list1 = null;ArrayList list2 = null ;list 1 = list2//编译通过...
2021-10-31 17:52:07 66
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人