05 2018 档案

摘要: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 阅读(491) 评论(0) 推荐(0)
摘要:File类常用方法归类 java文件操作 阅读全文
posted @ 2018-05-29 13:39 乐丶Sir 阅读(275) 评论(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 阅读(153) 评论(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 阅读(463) 评论(1) 推荐(0)
摘要:利用接口方法计算矩形面积 代码如下: //接口的定义与实现【public】 interface A{ //定义一个接口【public】 【static】【final】 void conter(double l,double w); //定义一个conter方法两个形参,这里的方法不能有方法体 } c 阅读全文
posted @ 2018-05-08 22:13 乐丶Sir 阅读(218) 评论(0) 推荐(0)