前言 自从 Java 8 开始,作为程序员的我们都离不开 Stream 相关功能的使用,书写起来那叫一个流畅(这个 feel~~)。但总是有一些时候,我们对 stream 的操作所要的结果和预期不符,这就需要我们逐步调试,定位问题 常规调试 先来看下面这段代码: public static void ...
分类:
其他好文 时间:
2021-05-24 14:27:05
阅读次数:
0
<?php class A{ function index (){ echo '我是A的index'; } } class B{ function index (){ echo '我是B的index'; } } class C{ function index (){ echo '我是C的index' ...
分类:
Web程序 时间:
2021-05-24 14:24:42
阅读次数:
0
static::、self::、new self()、new static() <?php class Father{ protected static $name = "大头"; public static function father_self(){ echo self::$name."\n" ...
分类:
其他好文 时间:
2021-05-24 14:21:29
阅读次数:
0
抽象工厂模式,定义工厂接口,生产某一种类型的配件全部由某一家工厂所提供,解决不同工厂的兼容性问题。 /** * 抽象工厂模式 */ public class AbstratFactoryMethod { public static void main(String[] args) { } } //数 ...
分类:
其他好文 时间:
2021-05-24 14:18:18
阅读次数:
0
一、卖票案例 //测试 public class CilentTest { public static void main(String arg[]){ Customer p1=new Children(); System.out.println(p1.calculate(100.00)); Cus ...
分类:
其他好文 时间:
2021-05-24 14:17:47
阅读次数:
0
public class WeatherUtil { private static final Logger LOGGER = LoggerFactory.getLogger(WeatherUtil.class); public static String doGet(String path){ S ...
分类:
其他好文 时间:
2021-05-24 14:15:35
阅读次数:
0
题目 给定一个序列,给出最大子序列的和。 解答 public class maxSubSum { public static int maxSubSum1(int [] a){ int maxSum = 0; for (int i = 0; i < a.length; i++) { for(int ...
分类:
编程语言 时间:
2021-05-24 14:09:52
阅读次数:
0
Hello,world Java代码: public class Hello{ public static void main(String[] args){ System.out.print("Hello,world!"); }} 编译: javac Hello.java //编译生成class文 ...
分类:
其他好文 时间:
2021-05-24 14:06:34
阅读次数:
0
<?php class One{ private static $_one; private function __construct(){} private function __clone(){} public static function getOne(){ if(!self::$_one ...
分类:
Web程序 时间:
2021-05-24 13:36:59
阅读次数:
0
countDownLatch这个类使一个线程等待其他线程各自执行完毕后再执行。 public class CountDownLatchDemo { public static void main(String[] args) throws InterruptedException{ /** * * ...
分类:
其他好文 时间:
2021-05-24 13:31:31
阅读次数:
0