1.自动装箱 ArrayList<Integer> list = new ArrayLlist<Integer>(); list.add(2); 自动变换为 list.addInteget.valueOf(2); 这种变换称为自动装箱。 2.自动拆箱 int n = list.get(i); 以上语 ...
分类:
其他好文 时间:
2020-02-12 13:14:39
阅读次数:
55
1 """ 2 Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. 3 Exa ...
分类:
其他好文 时间:
2020-02-12 00:58:45
阅读次数:
82
Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specificat ...
分类:
其他好文 时间:
2020-02-11 19:20:25
阅读次数:
64
内存溢出和内存泄漏 一、内存溢出和内存泄露概述 内存溢出 out of memory,是指程序在申请内存时,没有足够的内存空间供其使用,出现out of memory;比如申请了一个integer,但给它存了long才能存下的数,那就是内存溢出。内存泄露 memory leak,是指程序在申请内存后 ...
分类:
其他好文 时间:
2020-02-11 11:28:01
阅读次数:
62
一、枚举类型 1.枚举类型的格式就是enum+枚举类型的名称,可见下面的例子。 package com.bjpowernode.java_learning; ? public class D81_1_ { public static void main(String[] args) { /** * ...
分类:
编程语言 时间:
2020-02-11 09:40:25
阅读次数:
100
题目: Implement a MapSum class with insert, and sum methods. For the method insert, you'll be given a pair of (string, integer). The string represents t ...
分类:
编程语言 时间:
2020-02-11 00:19:01
阅读次数:
110
Given a positive integer X, an X-factor chain of length m is a sequence of integers, 1 = X0, X1, X2, …, Xm = X satisfying Xi < Xi+1 and Xi | Xi+1 wher ...
分类:
其他好文 时间:
2020-02-10 18:10:40
阅读次数:
107
1.java字符串转为int型: String id= 1; int id_int = Integer.parseInt(id); 2.java 字符串转为bool类型: parseBoolean函数:如果 String 参数不是 null 且在忽略大小写时等于"true",则返回的 boolean ...
分类:
编程语言 时间:
2020-02-10 17:46:45
阅读次数:
57
1]控件的OnCellContextClick的事件 procedure TMainForm.UniDBGrid1CellContextClick(Column: TUniDBGridColumn; X, Y: Integer); begin UniPopupMenu1.Popup(X, Y, Un ...
分类:
其他好文 时间:
2020-02-10 17:45:01
阅读次数:
80
1、什么是泛型 Java 泛型(generics)是 JDK5 中引入的一个新特性, 泛型提供了编译时类型安全检测机制,该机制允许开发人员在编译时检测到非法的类型。 泛型的本质是参数化类型,也就是说所操作的数据类型被指定为一个参数。 2、泛型的使用 泛型有三种使用方式,分别为:泛型类、泛型接口、泛型 ...
分类:
编程语言 时间:
2020-02-10 14:04:11
阅读次数:
75