摘要: import java.io.*; //导入程序相关需要用到的所有IO包 public class file1{ public static void main(String[] args) throws Exception{ //throws Exception 抛出异常不处理 File f=ne 阅读全文
posted @ 2018-06-02 11:16 乐丶Sir 阅读(2003) 评论(0) 推荐(0) 编辑
摘要: import java.io.File;import java.io.IOException; public class test2{ public static void main(String[] args){ File f=new File("e:"+File.separator+"test. 阅读全文
posted @ 2018-05-29 22:17 乐丶Sir 阅读(480) 评论(0) 推荐(0) 编辑
摘要: File类常用方法归类 java文件操作 阅读全文
posted @ 2018-05-29 13:39 乐丶Sir 阅读(270) 评论(0) 推荐(0) 编辑
摘要: class MyThread implements Runnable{ //利用Runnable接口实现多线程操作 private int ticket=5; //定义5个票数 public void run(){ for(int i=0;i<99;i++){ synchronized(this){ 阅读全文
posted @ 2018-05-27 21:24 乐丶Sir 阅读(145) 评论(0) 推荐(0) 编辑
摘要: class person{ //定义一个父类 private String name; private int age; private char sex; //在父类里面定义 三个属性,并且封装和一个person方法public person(){}public void setPerson(St 阅读全文
posted @ 2018-05-24 17:49 乐丶Sir 阅读(445) 评论(1) 推荐(0) 编辑
摘要: 利用接口方法计算矩形面积 代码如下: //接口的定义与实现【public】 interface A{ //定义一个接口【public】 【static】【final】 void conter(double l,double w); //定义一个conter方法两个形参,这里的方法不能有方法体 } c 阅读全文
posted @ 2018-05-08 22:13 乐丶Sir 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 使用记事本开发JAVA程序的步骤 阅读全文
posted @ 2018-03-28 22:27 乐丶Sir 阅读(129) 评论(0) 推荐(0) 编辑