摘要: Random rand = new Random(); String[] ArithmeticSign = { "+", "-", "" }; for(int n = 0;n<10;n++) { while (true) { String num = "1"; for (int i = 2; i < 阅读全文
posted @ 2020-06-15 08:55 神跃飞刀 阅读(192) 评论(0) 推荐(0)
摘要: Scanner sc = new Scanner(System.in); int size = sc.nextInt(); /** * 由于菱形的对角线是菱形的对称轴所以菱形的行数一定是奇数,所以输入偶数时需要加1或减1处理使其变为奇数 */ if (size % 2 != 0) { for (in 阅读全文
posted @ 2020-06-13 17:54 神跃飞刀 阅读(208) 评论(0) 推荐(0)
摘要: 1.下载JDK 官网地址:www.oracle.com 下载最新的Java14版本,推荐下载压缩版 jdk-14.0.1_windows-x64_bin.zip并解压。 如需下载其他版本官网最下方Java Archive有所有版本,如就常使用的1.8版本可以在此处查找,但1.8版本没有压缩版,并且需 阅读全文
posted @ 2020-06-13 17:54 神跃飞刀 阅读(66) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { String str = "java14jdk8baidu404我的博客"; Pattern p = Pattern.compile("\\d+"); Matcher m = p.matcher(str); int s 阅读全文
posted @ 2020-06-13 17:53 神跃飞刀 阅读(408) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { Scanner sc = new Scanner(System.in); String w = sc.next(); //有道词典的url地址 String url = String.format("https://y 阅读全文
posted @ 2020-06-13 17:51 神跃飞刀 阅读(143) 评论(0) 推荐(0)
摘要: 利用for循环比较删除重复的数据 public static void main(String[] args) { List<String> list = new ArrayList<>(); list.add("java"); list.add("php"); list.add("java"); 阅读全文
posted @ 2020-06-13 17:45 神跃飞刀 阅读(626) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { del(new File(f)); } public static void del(File f) { if(f.isDirectory()) { File[] fs = f.listFiles(); for(Fil 阅读全文
posted @ 2020-06-13 17:44 神跃飞刀 阅读(111) 评论(0) 推荐(0)
摘要: /** * java递归实现复制目录与文件,此方法效率极低不推荐使用 */ File f1 = new File(src); File f2 = new File(dst); try { FileInputStream fis1 = new FileInputStream(f1); FileInpu 阅读全文
posted @ 2020-06-13 17:43 神跃飞刀 阅读(692) 评论(0) 推荐(0)
摘要: static int rows = 0; static int num = 0; public static void main(String[] args) { show(new File(file)); System.out.println("共" + num + "个java文件,共" + r 阅读全文
posted @ 2020-06-13 17:41 神跃飞刀 阅读(214) 评论(0) 推荐(0)
摘要: /*** 水印文字效果*/ public static void string(File f) throws IOException { if (f.isDirectory()) { File[] fs = f.listFiles(); for (File a : fs) { if (a.isDir 阅读全文
posted @ 2020-06-13 17:39 神跃飞刀 阅读(253) 评论(0) 推荐(0)