- 博客(14)
- 收藏
- 关注
原创 JAVA I O 通过服务器传输文件(简单的)
服务器代码public class Server { static String homePath = System.getProperty("user.dir"); static String filePath = homePath + File.separator + "bb.txt"; public static void main(String[] args) throws I...
2018-07-27 20:46:24 566
原创 JAVA简单的I O流聊天程序 无线程
服务器: public class Server2 { public static final int PORT = 10001; public static void main(String[] args) throws Exception { System.out.println("server start....."); ServerSocket ss = new Se...
2018-07-27 10:42:17 222
原创 JAVA I 0流 copy文档的几种方式
第一种 :不用缓冲,用BufferedReader 和BufferedWriterpublic class TextPath { public static void main(String[] args) throws Exception { //.获取当前工程文件路径,separator连接工程路径与abc.txt路径 File file = new File("." + Fi...
2018-07-25 21:27:42 223
原创 Scanner中 next 和nextLine的区别
测试代码public class Text { public static void main(String[] args) { Scanner input = new Scanner(System.in); String s = input.nextLine(); System.out.println(s); s = input.next(); Syste...
2018-07-25 21:05:14 356
原创 文件File中list()和listFile()方法的区别
测试代码如下public class TextPath { public static void main(String[] args) { File file = new File("."); String[] list = file.list(); for (String it : list) { System.out.print(it + " "); } ...
2018-07-25 20:07:47 6975
原创 getPath()与getAbsolutePath()的区别
测试代码如下public class TextPath { public static void main(String[] args) { File file = new File("workspace\\test\\test1.txt"); //取得相对路径 System.out.println("Path: " + file.getPath()); //取得绝对路...
2018-07-25 19:48:56 37121 6
原创 简单的文件系统
Main类package com.baidu.MyFile;import java.io.IOException;public class Main { public static void main(String[] args) throws IOException { MyFile myFile = new MyFile(); myFile.run(); }}...
2018-07-25 19:04:47 577
原创 学生信息管理系统(二)
相对规范的小项目项目整体结构如下 主通道 Entry类public class Entry { //主函数 public static void main(String args[]) { PropertyConfigurator.configure(ConstantUtil.LOG4JCONFIGFILE); Menu menu = new Menu...
2018-07-24 19:27:42 561
原创 JAVA写一个简单的泛型方法比较Stirng、StringBuffer、StringBuilder处理字符串效率
public class Test { public static void main(String[] args) { System.out.println("String处理需要的时间 :" + testTime("abc")); System.out.println("StringBuffer处理需要的时间:" + testTime(new StringBuffer("abc")...
2018-07-24 19:16:04 395
原创 JAVA如何添加日志文件
[SSM配置Log4j打印日志,打印SQL语句](https://blog.csdn.net/qq_42651904/article/details/88981997)JAVA添加日志文件:首先导入需要的日志文件工具导入步骤如下图之后再创建名为 log4j.properties file(配置文件,配置文件只能放在src里面不能放在其他包里面不然会找不到)...
2018-07-19 21:11:50 13198
原创 JAVA简单的学生管理系统(一)(无数据库)
Subject public class Subject{ private String name;//学科名称 private String number; public Subject() {} public Subject(String name, String number) { this.name = name; ...
2018-07-18 21:34:42 4994 1
原创 JAVA简单的打字游戏
玩类package type_Game;import java.util.Scanner;public class Player { private int rank;//当前级别 private int currScore;//分数// private String startTime;//开始时间// private String elapseTi...
2018-07-17 17:56:43 3070
原创 JAVA简单的银行管理系统
账户类package Account;public abstract class Account { private int id;//账号 private String password;//密码 private String name;//姓名 private String personId;//身份证号码 private String ema...
2018-07-16 19:50:21 32869 5
原创 五大算法: 插入、选择、冒泡、快速、二分
JAVA经典算法链接:转载请注明出处:http://blog.csdn.net/l1028386804/article/details/51097928 *************************冒泡排序******************************int[] arr = {5, 1, 2, 3, 7, 8, 6, 4};int flag = 0;//0...
2018-07-11 15:17:35 315
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人