冥灭

导航

 

2019年11月9日

摘要: //定义一个学生类public class Student { //成员变量 private String name; private int age; private String address; //无参构造方法 public Student() { super(); } //有参构造方法 p 阅读全文
posted @ 2019-11-09 17:04 private_mingmie 阅读(549) 评论(0) 推荐(0)
 
摘要: //折半查找(二分法)public void arrayHalfQuery() { //定义一个数组,类型为int整型数据类型 int[] num = {1,3,4,7,9,10,12,15,17,19,21,22,25,26,28,29,30}; //定义一个要查找的key值 int key = 阅读全文
posted @ 2019-11-09 16:43 private_mingmie 阅读(400) 评论(0) 推荐(0)
 
摘要: public void arrayClooseSort() { int[] num = {10,14,3,8,11,9,2,4}; //选择排序,升序排序 for(int i = 0;i < num.length-1;i++) { for(int j = i + 1;j < num.length;j 阅读全文
posted @ 2019-11-09 16:40 private_mingmie 阅读(276) 评论(0) 推荐(0)
 
摘要: public void arrayBubblingSort() { //定义一个int类型数组,并赋值元素值 int[] num = {6,12,8,3,14,9,7,2,11}; //冒泡排序 for(int i = 0;i < num.length-1;i++) { //每次比较,把最大值依次放 阅读全文
posted @ 2019-11-09 16:37 private_mingmie 阅读(1959) 评论(0) 推荐(0)
 
摘要: //数组找最值public void arrayMax() { int[] num = {2,5,9,1,7,3}; int max = num[0]; for(int i = 1;i < num.length;i++) { if(max < num[i]) { int temp = num[i]; 阅读全文
posted @ 2019-11-09 16:32 private_mingmie 阅读(185) 评论(0) 推荐(0)
 
摘要: //数组倒置方法 public void arrayInvert() { char[] ch = {'a','b','c','d','e'}; for(int i = 0;i < ch.length/2;i++) { char temp = ch[i]; ch[i] = ch[ch.length-1 阅读全文
posted @ 2019-11-09 16:24 private_mingmie 阅读(1196) 评论(0) 推荐(0)
 

2019年11月8日

摘要: import java.io.BufferedInputStream;import java.io.BufferedOutputStream;import java.io.File;import java.io.FileInputStream;import java.io.FileOutputStr 阅读全文
posted @ 2019-11-08 11:23 private_mingmie 阅读(255) 评论(0) 推荐(0)
 
摘要: import java.io.BufferedReader;import java.io.BufferedWriter;import java.io.File;import java.io.FileReader;import java.io.FileWriter;import java.io.IOE 阅读全文
posted @ 2019-11-08 11:21 private_mingmie 阅读(682) 评论(0) 推荐(0)
 
摘要: import java.io.File;public class FindEndsWith { public static void main(String[] args) { //定义需要查找的父路径 File file = new File("E:"); //定义需要查找的后缀格式(.后缀名) 阅读全文
posted @ 2019-11-08 11:18 private_mingmie 阅读(644) 评论(0) 推荐(0)
 
摘要: import java.text.SimpleDateFormat;import java.util.Calendar;import java.util.Date;public class Times { public static void main(String[] args) { //调用da 阅读全文
posted @ 2019-11-08 11:16 private_mingmie 阅读(710) 评论(0) 推荐(0)