摘要:
package edu.wtbu;import java.util.HashMap;import java.util.Map;import java.util.Set;public class Demo01 { public static void main(String[] args) { //M 阅读全文
posted @ 2023-02-20 17:55
惊鸿宴远赴人间
阅读(35)
评论(0)
推荐(0)
摘要:
package edu.wtbu;import java.util.Comparator;import java.util.Iterator;import java.util.TreeSet;public class Demo01 { public static void main(String[] 阅读全文
posted @ 2023-02-20 13:21
惊鸿宴远赴人间
阅读(86)
评论(0)
推荐(0)
摘要:
package edu.wtbu;import java.util.HashSet;import java.util.Iterator;public class Demo01 { public static void main(String[] args) { //HashSet: 存储结构:哈希表 阅读全文
posted @ 2023-02-20 12:24
惊鸿宴远赴人间
阅读(288)
评论(0)
推荐(0)
摘要:
import java.util.HashSet;import java.util.Iterator;import java.util.Set;public class Demo01 { public static void main(String[] args) { //Set接口:无序,无下标, 阅读全文
posted @ 2023-02-20 11:11
惊鸿宴远赴人间
阅读(27)
评论(0)
推荐(0)
摘要:
import java.util.ArrayList;import java.util.Iterator;public class Demo01 { public static void main(String[] args) { //泛型的好处:1.提高代码的重用性 2.防止类型转换异常,提高代码 阅读全文
posted @ 2023-02-20 10:56
惊鸿宴远赴人间
阅读(16)
评论(0)
推荐(0)
摘要:
//泛型方法:<T> 返回值类型public class MyGeneric { public <T> T show(T t){ System.out.println("泛型方法:"+t); return t; }} public class Demo01 { public static void 阅读全文
posted @ 2023-02-20 10:41
惊鸿宴远赴人间
阅读(12)
评论(0)
推荐(0)
摘要:
//泛型接口:接口名<T> ,不能泛型静态常量public interface MyGeneric<T> { String name="张三"; T server(T t);} public class MyGenericImpl implements MyGeneric<String>{ @Ove 阅读全文
posted @ 2023-02-20 10:29
惊鸿宴远赴人间
阅读(35)
评论(0)
推荐(0)
摘要:
//泛型类:类名<T> ,T是类型占位符,表示一种引用类型,如果编写多个,使用逗号隔开public class MyGeneric<T> { //1.创建变量 T t; //2.添加方法:泛型作为方法的参数 public void show(T t){ System.out.println(t); 阅读全文
posted @ 2023-02-20 10:00
惊鸿宴远赴人间
阅读(23)
评论(0)
推荐(0)
浙公网安备 33010602011771号