06 2020 档案

摘要:public class Parentheses { public static void main(String[] args) { Stack<String> s = new Stack<>(); String string = StdIn.readString(); String[] inpu 阅读全文
posted @ 2020-06-30 18:49 硬盘红了 阅读(144) 评论(0) 推荐(0)
摘要:Student类: public class Student { public void study(){ System.out.println("好好学习,天天向上"); } } View Code Teacher类: public class Teacher { public void teac 阅读全文
posted @ 2020-06-21 21:38 硬盘红了 阅读(149) 评论(0) 推荐(0)
摘要:public class ReflectTest { public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { Ar 阅读全文
posted @ 2020-06-21 21:02 硬盘红了 阅读(142) 评论(0) 推荐(0)
摘要:public class ReflectDemo04 { public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, Invo 阅读全文
posted @ 2020-06-21 20:52 硬盘红了 阅读(116) 评论(0) 推荐(0)
摘要:Method[] getMethods() 返回包含一个数组 方法对象反射由此表示的类或接口的所有公共方法类对象,包括那些由类或接口和那些从超类和超接口继承的声明。 public class ReflectDemo03 { public static void main(String[] args) 阅读全文
posted @ 2020-06-21 17:06 硬盘红了 阅读(222) 评论(0) 推荐(0)
摘要:public class ReflectDemo02 { public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, Invo 阅读全文
posted @ 2020-06-21 15:24 硬盘红了 阅读(161) 评论(0) 推荐(0)
摘要:Field[] getFields() 返回包含一个数组Field对象反射由此表示的类或接口的所有可访问的公共字段类对象。 public class ReflectDemo01 { public static void main(String[] args) throws ClassNotFound 阅读全文
posted @ 2020-06-21 15:15 硬盘红了 阅读(550) 评论(0) 推荐(0)
摘要:public class ReflectDemo03 { public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, Invo 阅读全文
posted @ 2020-06-20 22:29 硬盘红了 阅读(86) 评论(0) 推荐(0)
摘要:Student类: package com.reflect_02; public class Student { private String name; int age; public String address; //构造方法:1个私有,1个默认,2个公开 public Student() { 阅读全文
posted @ 2020-06-20 22:21 硬盘红了 阅读(362) 评论(0) 推荐(0)
摘要:public class ReflectDemo02 { public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, Invo 阅读全文
posted @ 2020-06-20 22:00 硬盘红了 阅读(154) 评论(0) 推荐(0)
摘要:public class ReflectDemo { public static void main(String[] args) throws ClassNotFoundException { //1.使用类的class属性来获取该类对应的Class对象。 Class<Student> c1 = 阅读全文
posted @ 2020-06-20 20:53 硬盘红了 阅读(190) 评论(0) 推荐(0)
摘要:public class CollectorDemo { public static void main(String[] args) { List<String> list = new ArrayList<>(); list.add("林青霞"); list.add("张曼玉"); list.ad 阅读全文
posted @ 2020-06-19 21:49 硬盘红了 阅读(700) 评论(0) 推荐(0)
摘要:public class StreamTest { public static void main(String[] args) { //创建集合存储元素 ArrayList<String> manArray = new ArrayList<>(); manArray.add("刘德华"); man 阅读全文
posted @ 2020-06-19 21:07 硬盘红了 阅读(515) 评论(0) 推荐(0)
摘要:public class StreamDemo06 { public static void main(String[] args) { ArrayList<String> list = new ArrayList<>(); list.add("赵敏"); list.add("张无忌"); list 阅读全文
posted @ 2020-06-19 17:58 硬盘红了 阅读(1287) 评论(0) 推荐(0)
摘要:public class StreamDemo05 { public static void main(String[] args) { //创建一个集合,存储多个字符串元素 ArrayList<String> list = new ArrayList<>(); list.add("10"); li 阅读全文
posted @ 2020-06-19 17:52 硬盘红了 阅读(1065) 评论(0) 推荐(0)
摘要:public class StreamDemo04 { public static void main(String[] args) { //创建一个集合添加元素 ArrayList<String> list = new ArrayList<>(); list.add("linqingxia"); 阅读全文
posted @ 2020-06-19 17:38 硬盘红了 阅读(573) 评论(0) 推荐(0)
摘要:public class StreamDemo03 { public static void main(String[] args) { //创建一个集合 ArrayList<String> list = new ArrayList<>(); list.add("赵敏"); list.add("张无 阅读全文
posted @ 2020-06-19 17:18 硬盘红了 阅读(630) 评论(0) 推荐(0)
摘要:public class StreamDemo02 { public static void main(String[] args) { //创建一个集合 ArrayList<String> list = new ArrayList<>(); list.add("赵敏"); list.add("张无 阅读全文
posted @ 2020-06-19 17:10 硬盘红了 阅读(307) 评论(0) 推荐(0)
摘要:public class StreamDemo { public static void main(String[] args) { //创建一个集合 ArrayList<String> list = new ArrayList<>(); list.add("赵敏"); list.add("张无忌" 阅读全文
posted @ 2020-06-19 15:31 硬盘红了 阅读(637) 评论(0) 推荐(0)
摘要:不使用Stream流完成上述操作代码: public class StreamDemo { public static void main(String[] args) { //创建一个集合,存储多个字符串元素 ArrayList<String> list = new ArrayList<>(); 阅读全文
posted @ 2020-06-19 14:52 硬盘红了 阅读(140) 评论(0) 推荐(0)
摘要:public class FunctionTest { public static void main(String[] args) { String s = "林青霞,30"; convert(s, s1 -> s1.split(",")[1], s1 -> Integer.parseInt(s1 阅读全文
posted @ 2020-06-08 18:27 硬盘红了 阅读(133) 评论(0) 推荐(0)
摘要:public class FunctionDemo { public static void main(String[] args) { convert("100", s -> Integer.parseInt(s)); convert(100, i -> String.valueOf(i + 56 阅读全文
posted @ 2020-06-08 17:57 硬盘红了 阅读(608) 评论(0) 推荐(0)
摘要:public class PredicateTest { public static void main(String[] args) { String[] strArray = {"林青霞,30","柳岩,34","张曼玉,35","貂蝉,31","王祖贤,33"}; ArrayList<Stri 阅读全文
posted @ 2020-06-08 17:30 硬盘红了 阅读(219) 评论(0) 推荐(0)
摘要:public class PredicateDemo { public static void main(String[] args) { boolean b1 = checkString("hello", s -> s.length() > 8); System.out.println(b1); 阅读全文
posted @ 2020-06-08 15:55 硬盘红了 阅读(388) 评论(0) 推荐(0)
摘要:public class ConsumerTest { public static void main(String[] args) { String[] strArray = {"林青霞,30", "张曼玉,35", "王祖贤,40"}; printInfo(strArray, (String s 阅读全文
posted @ 2020-06-08 15:28 硬盘红了 阅读(163) 评论(0) 推荐(0)
摘要:public class ConsumerDemo { public static void main(String[] args) { operatorString("旭旭宝宝",s -> System.out.println(s)); operatorString("旭旭宝宝",s -> Sys 阅读全文
posted @ 2020-06-06 19:26 硬盘红了 阅读(542) 评论(0) 推荐(0)
摘要:public class SupplierTest { public static void main(String[] args) { //定义数组 int[] a = {10,20,33,12,99}; //调用方法获取最大值 int MaxValue = getMax(()->{ int Ma 阅读全文
posted @ 2020-06-06 18:57 硬盘红了 阅读(141) 评论(0) 推荐(0)
摘要:public class SupplierDemo { public static void main(String[] args) { String s = getString(()->"函数式接口"); System.out.println(s); Integer i = getInteger( 阅读全文
posted @ 2020-06-06 17:20 硬盘红了 阅读(146) 评论(0) 推荐(0)
摘要:public class ComparatorDemo { public static void main(String[] args) { ArrayList<String> array = new ArrayList<>(); array.add("a"); array.add("ccccc") 阅读全文
posted @ 2020-06-06 17:01 硬盘红了 阅读(250) 评论(0) 推荐(0)
摘要:public class RunnableDemo { public static void main(String[] args) { //使用匿名类调用方法 startThread(new Runnable() { @Override public void run() { System.out 阅读全文
posted @ 2020-06-05 16:18 硬盘红了 阅读(186) 评论(0) 推荐(0)