摘要: package com.woniuxy.java2; public class MyThreadTest { public static int ticket = 100; public static Object lock = new Object(); public static void ma 阅读全文
posted @ 2022-08-13 10:44 传说中的旅行者 阅读(5) 评论(0) 推荐(0) 编辑
摘要: public class MainApp { public static void main(String[] args) { Connection conn = DBUtil1.getConnection(); try { conn.close(); //这个conn关闭的话,工具类里面的conn 阅读全文
posted @ 2022-08-11 11:55 传说中的旅行者 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 项目结构 1.配置文件 config,properties packageName = com.woniu.dao.impl 2.自定义注解 package com.woniu.util; import java.lang.annotation.ElementType; import java.la 阅读全文
posted @ 2022-07-30 19:13 传说中的旅行者 阅读(56) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-07-29 15:12 传说中的旅行者 阅读(5) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int countValidWords(String sentence) { boolean flag = true; String [] strs = sentence.split(" "); int count=0;int gen=0; for(i 阅读全文
posted @ 2022-01-27 17:42 传说中的旅行者 阅读(25) 评论(0) 推荐(0) 编辑
摘要: 5980. 将字符串拆分为若干长度为 k 的组 字符串 s 可以按下述步骤划分为若干长度为 k 的组: 第一组由字符串中的前 k 个字符组成,第二组由接下来的 k 个字符串组成,依此类推。每个字符都能够成为 某一个 组的一部分。 对于最后一组,如果字符串剩下的字符 不足 k 个,需使用字符 fill 阅读全文
posted @ 2022-01-16 11:12 传说中的旅行者 阅读(49) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int totalMoney(int n) { int sum = 0; int[] arr = {1,2,3,4,5,6,7}; int month = n/7; int day = n%7; for(int i=0;i<month;i++){ fo 阅读全文
posted @ 2022-01-15 08:51 传说中的旅行者 阅读(6) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int dominantIndex(int[] nums) { if(nums.length==1) return 0; int[] nums1 = new int[nums.length]; for(int i=0;i<nums.length;i++ 阅读全文
posted @ 2022-01-13 09:21 传说中的旅行者 阅读(29) 评论(0) 推荐(0) 编辑
摘要: class Solution { public boolean isUnique(String astr) { char[] str = astr.toCharArray(); Arrays.sort(str); boolean flag = true; for(int i=0;i<str.leng 阅读全文
posted @ 2022-01-11 12:01 传说中的旅行者 阅读(20) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int search(int[] nums, int target) { int count = 0; for(int i=0;i<nums.length;i++){ if(nums[i]==target){ count++; } } return c 阅读全文
posted @ 2022-01-06 20:06 传说中的旅行者 阅读(2) 评论(0) 推荐(0) 编辑