任何可以产生对象的方法或类,都可以称为工厂。
下面的代码定义了Car这种交通工具:
public class Car {public void go() {System.out.println("Car go wuwuwuwuw....");}
}然后在main函数里面想要调用调用Car的go方法,就需要new一个car对象&…
哈希表
/*** Definition for singly-linked list.* class ListNode {* int val;* ListNode next;* ListNode(int x) {* val x;* next null;* }* }*/
public class Solution {public ListNode detectCycle(ListNode head) {Set<ListNode&…
1. MAT(Memory Analyzer Tool)的介绍
官方介绍 The Eclipse Memory Analyzer is a fast and feature-rich Java heap analyzer that helps you find memory leaks and reduce memory consumption. Use the Memory Analyzer to analyze productive heap …