自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(10)
  • 收藏
  • 关注

原创 把file2里面的内容读出来复给file

public class StringIoTool { public static String read(String filename) throws IOException{ Reader reader=new FileReader(filename); BufferedReader bf=new BufferedReader(reader); StringBuilder sb=new StringBuilder(); String str; do { str =bf.readLine(); if(

2021-11-27 23:57:16 112

原创 BankExample

public class BankExample { private int money; public BankExample(int money){ this.money =money; } public synchronized void takeOut(String usr,int moneyOut){ try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } money = money

2021-11-27 23:56:16 92

原创 RunnableTest

public class RunnableTest implements Runnable { private String name; public RunnableTest(String name){ this.name = name; System.out.println(name+“创建”); } public void run() { for(int i=0;i<4;i++){ System.out.println(name+“运行:”+i); } System.out.println(na

2021-11-27 23:54:59 111

原创 ThreadBase

public class ThreadBsae { public static void main(String[] args){ ThreadTest th1 = new ThreadTest(“Thread-1”); ThreadTest th2 = new ThreadTest(“Thread-2”); RunnableTest run1 = new RunnableTest(“Thread-3”); Thread thr1 = new Thread(run1); th1.start(); th2.s

2021-11-27 23:54:03 169

原创 ThreadTest

public class ThreadTest extends Thread {//继承方式 private String name; public ThreadTest(String name) { this.name = name; System.out.println(name+“创建”); } public void run() { for(int i=0;i<4;i++){ System.out.println(name+“运行:”+i); } System.out.println(name

2021-11-27 23:52:21 152

原创 简易版计算器

public class Caculator { private JTextField outputField; private double num1,num2; private String oper; public Caculator() { JFrame frame=new JFrame(“计算器”);//顶层容器 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//关闭程序 frame.setSize(500,500);//程序大小 fra

2021-11-27 21:27:04 60

原创 简易版记事本

public class TextPad { private JTextArea contentArea; private JFrame frame; private String filename; public TextPad() { frame=new JFrame(“记事本”); frame.setSize(700,600); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //添加菜单功能 JMenuBar menubar=new JMe

2021-11-27 21:14:24 171

原创 计算器

public class Caculator { private JTextField outputField; private double num1,num2; private String oper; public Caculator() { JFrame frame=new JFrame(“计算器”);//顶层容器 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(500,500); frame.setLayout

2021-11-22 23:25:46 63

原创 定义复数类

public class Complex {//定义复数类 public double real;//定义实部 public double empty;//定义虚部 public Complex() { } public Complex(double real,double empty) { this.real = real; this.empty = empty; } public double getReal() { return real; } public void setReal(double r

2021-11-22 23:24:39 213

原创 人民币换算

public class convert_money { //132.12 public static String toString(double x) { String result = “”; String yuan=“亿千百拾万千百拾元角分”; String digit =“零壹贰叁肆伍陆柒捌玖”; int y=(int)(x*100);//13212 for(int i =yuan.length()-1;y>0&&i>0;i–,y=y/10) { result =""+

2021-11-22 23:14:47 298

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除