PostgreSQL 使用 CREATE TABLE 语句来创建数据库表格。 语法 CREATE TABLE 语法格式如下: CREATE TABLE table_name( column1 datatype, column2 datatype, column3 datatype, ..... co ...
分类:
数据库 时间:
2020-07-27 17:37:46
阅读次数:
104
Given the root of a binary tree and an integer distance. A pair of two different leaf nodes of a binary tree is said to be good if the length of the s ...
分类:
其他好文 时间:
2020-07-27 15:58:17
阅读次数:
93
class Solution { public int countPairs(TreeNode root, int distance) { dfs(root,0,distance); return res; } private int res = 0; public List<Integer> df ...
分类:
其他好文 时间:
2020-07-27 13:50:30
阅读次数:
114
泛型泛型:可以在类或方法中预支地使用未知的类型。tips:一般在创建对象时,将未知的类型确定具体的类型。当没有指定泛型时,默认类型为Object类型。通过我们如下代码体验一下:publicclassGenericDemo2{publicstaticvoidmain(String[]args){Collection<String>list=newArrayList<String&g
分类:
其他好文 时间:
2020-07-27 09:55:32
阅读次数:
87
[编程题] lc 169. 多数元素 题目 输入输出 Java代码(方法1:借用哈希表计数) //方法1:借助哈希 public int majorityElement(int[] nums) { HashMap<Integer,Integer> map = new HashMap<>(); for ...
分类:
其他好文 时间:
2020-07-27 09:38:33
阅读次数:
51
package com.jeesite.modules.jiQiao.web;import java.util.stream.Stream;public class DemoMapTest07 { public static void main(String[] args) { // stream流 ...
分类:
其他好文 时间:
2020-07-26 22:59:16
阅读次数:
112
示例如下: boolean ? Object o1 : Object o2 编译时就必须保证o1和o2为同一类型变量 Object o = true ? new Integer(1) : new Double(2.0); System.out.println(o); //1.0 先把后边两个对象转换 ...
分类:
其他好文 时间:
2020-07-26 19:13:48
阅读次数:
71
题目 把十进制整数转化为二进制整数 输入: 2 0 -12 1 输出: 2-->10 0-->0 -12-->-1100 1-->1 思路: 1、定义一个私有的F方法,用于优化代码 2、用Scanner在main中实现键盘录入,变量为sc 3、使用while循环操作hasNext()方法,并调用F方 ...
分类:
其他好文 时间:
2020-07-26 15:59:24
阅读次数:
73
##题面 he length of the longest common prefix of two strings s=s1s2…sn and t=t1t2…tm is defined as the maximum integer k (0≤k≤min(n,m)) such that s1s2…s ...
分类:
其他好文 时间:
2020-07-26 00:15:56
阅读次数:
106
简而言之:就是返回一个字符串对象,显示的格式为这样子: getClass().getName() + '@' + Integer.toHexString(hashCode()) 所以在实体类中我们都会重写toString()方法,可以显示一些有意义的东西,例如 下面这篇有更详细的介绍 https:/ ...
分类:
编程语言 时间:
2020-07-25 23:50:39
阅读次数:
67