随笔分类 -  Java SE 编程练习

demo
摘要:import java.io.*; import java.util.*; public class TestDataOutputStream{ public static void main(String[] args){ try{ ByteArrayOutputStream baos = new 阅读全文
posted @ 2020-03-03 10:11 yxfyg 阅读(168) 评论(0) 推荐(0)
摘要:import java.io.*; public class TestOutputStreamWriter{ public static void main(String[] args){ try{ OutputStreamWriter osw = new OutputStreamWriter(ne 阅读全文
posted @ 2020-03-03 10:09 yxfyg 阅读(154) 评论(0) 推荐(0)
摘要:import java.io.*; public class TestInputStreamReader{ public static void main(String[] args){ try{ InputStreamReader isr = new InputStreamReader(Syste 阅读全文
posted @ 2020-03-03 10:05 yxfyg 阅读(300) 评论(0) 推荐(0)
摘要:import java.io.*; public class TestBufferedReader{ public static void main(String[] args){ try{ BufferedReader br = new BufferedReader(new FileReader( 阅读全文
posted @ 2020-03-02 15:57 yxfyg 阅读(583) 评论(0) 推荐(0)
摘要:import java.io.*; public class TestFileOutputStream{ public static void main(String[] args){ try{ FileOutputStream out = new FileOutputStream("D:/Java 阅读全文
posted @ 2020-03-02 11:43 yxfyg 阅读(361) 评论(0) 推荐(0)
摘要:import java.io.*; public class TestFileInputStream{ public static void main(String[] args){ FileInputStream in = null; try{ in = new FileInputStream(" 阅读全文
posted @ 2020-03-02 11:06 yxfyg 阅读(1058) 评论(0) 推荐(0)
摘要:import java.io.*; public class FileList{ void tree(File file , int level){ String str = ""; for(int i=0;i<level;i++){ str += " "; } File[] list = file 阅读全文
posted @ 2020-03-01 19:59 yxfyg 阅读(128) 评论(0) 推荐(0)
摘要:import java.io.*; public class CreateFile{ public static void main(String[] args){ String[] str = new String[6]; str[0] = "D:/A/B/E"; str[1] = "D:/A/B 阅读全文
posted @ 2020-03-01 10:44 yxfyg 阅读(712) 评论(0) 推荐(0)
摘要:public class StringToArray{ public static void main(String[] args){ String str = "2,6;6,9,3;2,6,3,7"; String[] first = str.split(";"); int[][] array = 阅读全文
posted @ 2020-02-26 20:49 yxfyg 阅读(1684) 评论(0) 推荐(0)
摘要:public class CountJava{ public static void main(String[] args){ String str = "dnajjavaNISLjavaERBjavafvsbdjavaFALjavaEUIcjavazs"; int count = 0; int i 阅读全文
posted @ 2020-02-26 11:27 yxfyg 阅读(211) 评论(0) 推荐(0)
摘要:public class ClassfiedChar{ public static void main(String[] args){ String str = "ahGJ;j:NLKn;[][]mpon;l()mp'mUIGGUILB"; char[] array = str.toCharArra 阅读全文
posted @ 2020-02-26 10:48 yxfyg 阅读(708) 评论(0) 推荐(0)
摘要:public class BinarySearch{ int[] a = {6,9,4,14,3,2,1,8,9,12,10,5,7}; void bubbleSort(int[] a){ if(a.length == 0){ System.out.println("错误!数组长度不能为0"); S 阅读全文
posted @ 2020-02-26 09:47 yxfyg 阅读(942) 评论(0) 推荐(0)
摘要:public class Count3Quit{ //从数组的角度 public void m1(){ boolean[] child = new boolean[500]; for(int i=0;i<child.length;i++){ child[i] = true; } int count 阅读全文
posted @ 2020-02-21 19:09 yxfyg 阅读(544) 评论(0) 推荐(0)
摘要:import java.util.*; public class OrderDate{ public static void main(String[] args){ Date[] days = new Date[5]; days[0] = new Date(2020,1,1); days[1] = 阅读全文
posted @ 2020-02-21 10:23 yxfyg 阅读(297) 评论(0) 推荐(0)
摘要:public class OrderNumber{ public static void main(String[] args){ if(args == null){ System.out.println("错误!没有检测到数据输入"); System.exit(-1); } if(args.len 阅读全文
posted @ 2020-02-20 17:04 yxfyg 阅读(298) 评论(0) 推荐(0)
摘要:public class Fibonacii{ public int m1(int n){ if(n == 1||n == 2){ return 1; } return m1(n-1) + m1(n-2); } public int m2(int n){ if(n == 1||n == 2){ re 阅读全文
posted @ 2020-02-19 20:54 yxfyg 阅读(172) 评论(0) 推荐(0)
摘要:public class GetPrime{ public void m1(){ boolean flag = true; for(int i=101;i<200;i+=2){ flag = true; for(int j=3;j<i;j++){ if(i%j == 0){ flag = false 阅读全文
posted @ 2020-02-19 19:01 yxfyg 阅读(216) 评论(0) 推荐(0)
摘要:public class BeDivided { public void m1(){ int count = 0; for(int i=1;i<=100&&count<5;i++){ if(i%3 == 0){ count++; System.out.print(i+" "); } } } publ 阅读全文
posted @ 2020-02-19 18:02 yxfyg 阅读(640) 评论(0) 推荐(0)
摘要:public class OddSum{ //计算1+2+3+...+99的值 public void odd1(){ int result = 0; for(int i=1;i<=99;i++){ result += i; } System.out.println(result); } //计算1 阅读全文
posted @ 2020-02-19 15:42 yxfyg 阅读(283) 评论(0) 推荐(0)
摘要:输出 HelloWorld! public class HelloWorld{ public static void main(String[] args){ System.out.println("HelloWorld!"); } } 阅读全文
posted @ 2020-02-19 12:57 yxfyg 阅读(82) 评论(0) 推荐(0)