摘要: //相当于创建一个指针数组int*[],每一个数组元素是一个指针,代表一行,共r行int * *ar = new int*[r] ;for (int i = 0 ;i< r ; i++){*(ar+i) = new int[c]; 阅读全文
posted @ 2015-11-05 23:07 喵小喵~ 阅读(218) 评论(0) 推荐(0) 编辑
摘要: private boolean judge(String str){ int year = 0; try{ year = Integer.valueOf(str).intValue(); }catch(NumberFormatExcep... 阅读全文
posted @ 2015-11-05 20:38 喵小喵~ 阅读(197) 评论(0) 推荐(0) 编辑
摘要: import java.awt.Color;import java.awt.FlowLayout;import java.awt.event.*;import javax.swing.*;public class ButtonInfoShowDemo1 extends JFrame implemen... 阅读全文
posted @ 2015-11-03 21:43 喵小喵~ 阅读(673) 评论(0) 推荐(0) 编辑
摘要: //使用匿名内部类,隐式调用外部变量,外部变量需要final修饰。 阅读全文
posted @ 2015-11-03 21:17 喵小喵~ 阅读(126) 评论(0) 推荐(0) 编辑
摘要: FlowLayout :组件在一行中按加入的先后顺序从左至右水平排列,排满后折行,每行中的组件都居中排列。BorderLayout:把容器空间划分为北、南、西、东、中五个区,每加入一个组件都应说明把这个组件加在那个区域中。GridLayout:以行和列的网格形式安排组件CardLayout:每一个组... 阅读全文
posted @ 2015-11-03 20:27 喵小喵~ 阅读(150) 评论(0) 推荐(0) 编辑
摘要: package 学生管理系统;import java.io.*;import java.util.Arrays;import java.util.Comparator; import java.util.ArrayList;import java.util.Scanner;class Student... 阅读全文
posted @ 2015-11-03 19:22 喵小喵~ 阅读(164) 评论(0) 推荐(0) 编辑
摘要: import java.io.*;public class FileOperate { //创建指定目录 void makeDirectory(String dirName){ File file = new File(dirName);//实例化文件对象 t... 阅读全文
posted @ 2015-11-03 19:11 喵小喵~ 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 1.方法一try{ RandomAccessFile randomFile = new RandomAccessFile(path,"rw"); long fileLength = randomFile.length(); randomFile.seek(fileLength); Strin... 阅读全文
posted @ 2015-11-03 18:17 喵小喵~ 阅读(328) 评论(0) 推荐(0) 编辑
摘要: //缓冲输入用于对缓冲读取的写入BufferedReader br = new BufferedReader(new FileReader("G:\\aillo.txt"));BufferedWriter bw = new BufferedWriter(new FileWriter("G:\\jac... 阅读全文
posted @ 2015-11-02 20:59 喵小喵~ 阅读(206) 评论(0) 推荐(0) 编辑
摘要: try{//创建FileWrier对象,用来写入字符串String fileName = "F:\\n.txt";//创建文件输出对象流 用文件对象作为参数 则对该文件进行输出操作FileOutputStream fos = new FileOutputStream(new File(fileNam... 阅读全文
posted @ 2015-11-02 20:51 喵小喵~ 阅读(135) 评论(0) 推荐(0) 编辑