package com.smile.test.sort.bubble; /** * 冒泡排序 时间复杂度O(n^2) */ public class Bubble { static void sort(Comparable[] a){ for (int i = a.length-1; i>0; i- ...
分类:
编程语言 时间:
2021-04-16 12:06:55
阅读次数:
0
参见微软官方 https://docs.microsoft.com/en-us/windows/win32/sysinfo/operating-system-versionusing System; using System.Collections.Generic; using System.Lin ...
一:常量(constant) 1、有常量就有变量 2、常量一般使用大写的字符 3、常量定义以后一般是不能进行改变的 4、常量的定义:final 常量名=值; 5、设定常量后是不能被改变的(初始化常量)initialize(自定义)初始化定义后,不能改变的值,也是不能标动的值 6、final属于修饰符 ...
分类:
其他好文 时间:
2021-04-16 11:56:51
阅读次数:
0
# 捕获异常,异常之后,代码不再执行 try : a = 1/0 except ZeroDivisionError as e : print('出异常了,原因:',e) except IOError as e: print('IO异常,原因:', e) except ValueError as e: ...
分类:
编程语言 时间:
2021-04-16 11:51:04
阅读次数:
0
数组遍历方式参考: 方法一:for循环遍历 public static void main(String[] args) { int Arr[][]={{1,2,3},{4,5,6}}; for (int i = 0; i < Arr.length; i++) { for (int j = 0; j ...
分类:
编程语言 时间:
2021-04-16 11:45:39
阅读次数:
0
public class Test { public static void main(String[] args) { int a = 3; int b = a++; //a先给b赋值,所以b是3,然后再自增1,所以再输出a为4 System.out.println(a); //输出结果 4 in ...
分类:
其他好文 时间:
2021-04-15 12:49:34
阅读次数:
0
题目描述 有一个集合组成的list,如果有两个集合有相同的元素,将他们合并。返回最后还剩下几个集合。 集合数 n <= 1000。 每个集合的元素个数 m <= 100。 元素一定是非负整数,且不大于 100000。 样例 样例1: 输入:list = [[1,2,3],[3,9,7],[4,5,1 ...
分类:
其他好文 时间:
2021-04-15 12:24:32
阅读次数:
0
package ShunXuDome;public class forDOme05 { public static void main(String[] args) { int[]numbers={10,20,30,40,50};//定义了一个数组 for (int i = 0; i < 5; i+ ...
分类:
其他好文 时间:
2021-04-15 12:23:41
阅读次数:
0
事件监听 当某个事件发生,会产生什么? public class Demo01 { public static void main(String[] args) { //按下按钮,触发事件 Frame frame = new Frame(); Button button = new Button() ...
分类:
其他好文 时间:
2021-04-14 12:40:04
阅读次数:
0
增强for循环 public class ForDemo{ public static void main(String[] args){ int[] numbers = {10,20,30,40,50}; //遍历数组元素 for(int x:numbers){ System.out.printl ...
分类:
编程语言 时间:
2021-04-14 12:36:49
阅读次数:
0