public static void main(String[] args) { //打印三角形 5行 for (int i = 1; i <= 5; i++) { for (int j=5;j>=i;j--){ System.out.print(" "); } for (int j = 1; j ...
分类:
其他好文 时间:
2021-01-02 10:29:54
阅读次数:
0
java 程序中测试两个变量是否相等有两种方法: == equals()方法 当使用==判断两个变量是否相等时,如果两个变量是基本类型变量,且都是数值类型(不一定要求数据类型严格相同),则只要两个变量的值相等时,才会返回true public class m{ 10 public static vo ...
分类:
编程语言 时间:
2021-01-02 10:28:43
阅读次数:
0
排序大家都经常用的吧,下面是个学生类,2 个字段:id[学号],score[分数], public class Stu { //编号 private Integer id; //分数 private Integer score; public Stu(Integer id, Integer scor ...
分类:
编程语言 时间:
2021-01-01 13:00:11
阅读次数:
0
this关键字代指当前对象,可在方法中区分全局变量和局部变量 public class ThisTest { private int age; public ThisTest(){ System.out.println("我是空参"); } public ThisTest(int age){ thi ...
分类:
其他好文 时间:
2021-01-01 12:56:30
阅读次数:
0
思路:回溯搜索 + 剪枝。 注意,回溯做选择的方法,不适用于有 “有重复元素的数组”。因此,重点掌握 常规回溯算法的写法。 class Solution { public List<List<Integer>> combinationSum2(int[] candidates, int target ...
分类:
其他好文 时间:
2021-01-01 12:54:26
阅读次数:
0
在ExcelUtil.java中修改函数fillExcelData,判断是否为字段规范表的导出。 public void fillExcelData(int index, Row row){ int startNo = index * sheetSize; int endNo = Math.min( ...
分类:
数据库 时间:
2021-01-01 12:52:29
阅读次数:
0
前序 class Solution { public: vector<int> preorderTraversal(TreeNode* root) { vector<int> res; if (root == nullptr) { return res; } stack<TreeNode*> stk ...
分类:
其他好文 时间:
2021-01-01 12:36:16
阅读次数:
0
1 public class MyClass 2 { 3 public static void UseParams(params int[] list) 4 { 5 for (int i = 0; i < list.Length; i++) 6 { 7 Console.Write(list[i] + ...
class User { int _id; public int Id { get { return _id; } set { _id = value; } } string _name; public string Name { get { return _name; } set { _name ...
分类:
其他好文 时间:
2021-01-01 12:10:52
阅读次数:
0
class HelloChina{ public static viod main(String[] args){ System.out.println("hello,world"); } } ...
分类:
编程语言 时间:
2021-01-01 12:02:08
阅读次数:
0