接口的定义和实现: 接口和接口的实现类: Timeservice: package com.cheng.inter;//接口的关键词是interfacepublic interface TimeService { void timer();}? Userservice: package com.ch ...
分类:
其他好文 时间:
2021-07-01 17:07:01
阅读次数:
0
import lombok.*; /** * @author: Small sunshine * @Description: * @date: 2021/6/30 8:05 下午 */ public class SortTree { public static void main(String[] ...
分类:
其他好文 时间:
2021-07-01 17:04:50
阅读次数:
0
public class QuickSort<T extends Comparable<T>> extends Sort<T> { @Override protected void sort() { sort(0, array.length); } /** * 对 [begin, end) 范围的元 ...
分类:
编程语言 时间:
2021-07-01 17:03:00
阅读次数:
0
public class MergeSort<T extends Comparable<T>> extends Sort<T> { private T[] leftArray; @Override protected void sort() { leftArray = (T[]) new Compa ...
分类:
编程语言 时间:
2021-07-01 16:59:30
阅读次数:
0
一、依赖倒转原则介绍 二、依赖倒转原则引入 1.方式一(传统方式) public class DependencyInversion { public static void main(String[] args) { Person person = new Person(); person.rec ...
分类:
其他好文 时间:
2021-07-01 16:40:10
阅读次数:
0
一、单一职责原则介绍 二、单一职责原则引入 1.方式一(违反了单一职责原则) 解析:摩托车、汽车是公路上运行的,但飞机并不是在公路上运行的。 public class SingleResponsibility1 { public static void main(String[] args) { / ...
分类:
其他好文 时间:
2021-07-01 16:31:05
阅读次数:
0
#region 毫秒延时 界面不会卡死 public static void Delay(int mm) { DateTime current = DateTime.Now; while (current.AddMilliseconds(mm) > DateTime.Now) { Applicati ...
分类:
移动开发 时间:
2021-07-01 16:29:40
阅读次数:
0
1、字符串转十六进制 代码实现: void StrToHex(char *pbDest, char *pbSrc, int nLen){ char h1,h2; char s1,s2; int i; for (i=0; i<nLen/2; i++) { h1 = pbSrc[2*i]; h2 = p ...
分类:
编程语言 时间:
2021-07-01 16:28:54
阅读次数:
0
1.创建一个Android Demo项目,设置拍照,读取等权限(基本的就不讲了,主要说明重点。) 2.创建自定义View public class CropImageView extends View { // 在touch重要用到的点, private float mX_1 = 0; privat ...
分类:
移动开发 时间:
2021-07-01 16:20:29
阅读次数:
0
一、单例模式定义 单例模式是指确保一个类在任何情况下都绝对只能有一个实例,并提供一个全局访问点。减少内存开销,避免对资源的多重占用。 二、饿汉式单例 1.代码示例 1 //标准写法 2 public class HungrySingleton { 3 4 private HungrySingleto ...
分类:
其他好文 时间:
2021-06-30 18:43:54
阅读次数:
0