自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 数据库

MYSQL /* * 数据: * 就是描述事物的符号。除了常用的数字数据外,还如图形、图像、声音、视频等。 * * 数据的保存: * 1.保存在内存中 * 优点:读取的速度快 * 缺点:程序一旦关闭或者计算机关机,数据就丢失。 * * 2.保存到文件中 * 优点: 数据可以永久的

2018-02-02 18:34:17 267

原创 java————Reflect(反射)

Reflect java反射机制是在运行状态中,对于任意一个类,都能够知道这个类的所有属性和方法;对于任意一个对象,都能够调用他的任意一个方法和属性;这种动态获取的信息以及动态调用对象的方法的功能称为java语言的反射机制。 先创建一个类 public class TestStar { private String name; public int age; public TestS

2018-02-01 19:34:46 201

原创 java————TCP

TCP/IP TCP/IP协议是一个协议的集合,分为四层:应用层,传输层,网络层,数据链路层。它和UDP的重要区别是有连接。 客户端 public class TestClient { public static void main(String[] args) throws IOException { InetAddress address=InetAddress.getBy

2018-02-01 19:21:50 353

原创 java————UDP

UDP 一种无连接的协议,具有资源消耗少,处理速度快的优点,重要特点是无连接,不存在服务器和客户端,只存在接受者和发送者。 发送者 /*public DatagramPacket(byte[] buf, int length, InetAddress address, int

2018-02-01 19:15:36 224

原创 java————输入输出流3

/*FileReader * FileWriter * 字符 * 只能用于处理文本!; * * 视频和图片用 字节 流来处理!!! */ public class TestIO4 { public static void main(String[] args) throws IOException { test4(); } /* * 一次读取一个 字符

2018-01-27 16:51:32 114

原创 java————输入输出流2

/* * 缓冲池 */ public class TestIO3 { public static void main(String[] args) throws IOException { test5(); } /* * BufferedInputStream bis=new BufferedInputStream(fis); * */ public static

2018-01-27 16:48:54 125

原创 java————异常的处理—try/catch

public class TestIO2 { public static void main(String[] args) { test1(); } /* * 不往上面throws,利用try/catch */ public static void test1() { FileOutputStream fos = null; try { fos =

2018-01-27 16:47:47 372

原创 java————输入输出流1

/* * 输入输出是相对于内存而言的! * 输入:从硬盘到内存 * 输出:从内存到硬盘 */ public class TestIO1 { public static void main(String[] args) throws IOException { test5(); } public static void test() throws IOExceptio

2018-01-27 16:43:37 129

原创 java————泛型

public class ObjectTool { public static void main(String[] args) { /* * 泛型类调用 */ // 等号两头泛型需保持一致! ObjectTool1 obj1 = new ObjectTool1(); obj1.setObj("111"); obj1.printMess

2018-01-23 16:55:49 116

原创 java————用递归算法求阶乘

public class TestRecursion { public static void main(String[] args) { int i; System.out.println("请输入需要阶乘的一个整数:"); Scanner scanner = new Scanner(System.in); i = scanner.nextInt();

2018-01-22 16:58:01 7134 2

原创 java————二分查找

/*二分查找 * */ public class Testsearch { public static void main(String[] args) { int[] intArray = { 1, 3, 5, 7, 9, 88 }; int key = 2; System.out.println("key的索引值为" + binarySearch(int

2018-01-22 15:20:27 102

原创 java————冒泡排序和简单选择排序

public class Textsort { public static void main(String[] args) { int[] intArray = { 5, 4, 1, 8, 44, 2 }; // bubble(intArray); choose(intArray); } //冒泡排序方法 public static void bubbl

2018-01-22 15:19:30 117

原创 String类————一个字符串在另一个字符串中出现的次数

/*一个字符串在另一个字符串中出现的次数 * */ public class textString3 { public static void main(String[] args) { textString3 s3 = new textString3(); System.out.println(s3.count()); } public static int

2018-01-18 16:28:25 605

原创 简单登录系统

public class textString { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String userName = ""; String passWord = ""; //登录允许错误次数time int time =

2018-01-18 16:24:32 494

原创 String类

public class textString { public static void main(String[] args) { // String类的构造方法 String s1 = new String(); System.out.println(s1); System.out.println("------------------------------

2018-01-18 16:21:35 109

原创 面向对象————object类

/*public boolean equals(Object obj)默认情况下比较的是地址,一般建议重写该方法。(例18-22行) * */ public class Textobject { public static void main(String[] args) { Textobject s1 = new Textobject(); Textobject s

2018-01-16 16:37:08 193

原创 面向对象——单例模式

/*第一步:把构造方法私有 * 第二步:在成员位置自己创建一个对象 * 第三步:通过一个公共的方法提供访问 * */ public class Singleton { public static void main(String[] args) { Printer p1 = Printer.getPriner(); Printer p2 = Printer.g

2018-01-12 20:32:22 132

原创 面向对象——super的用法

/*super不能在static下调用 * */ public class Textsuper { public static void main(String[] args) { Daugh d=new Daugh(); d.playPoke(" "); } } class Mother { int money = 1231232133;

2018-01-12 20:29:45 543

原创 面向对象——重写

public class TextOverride { public static void main(String[] args) { Daughter d=new Daughter(); d.playPoke(" "); } } class Mather { int money = 1231232133; String car = “humma

2018-01-12 20:28:53 270

原创 面向对象——接口

public class Textinterface { public static void main(String[] args) { Pencil p = new Pencil(); p.clean(); p.write(); p.light(); } } class Pen { String name; public Pen() {

2018-01-12 20:27:17 204

原创 面向对象——抽象方法

public class TextAbstract { public static void main(String[] args) { Rect len = new Rect(2, 3); double L = len.getLen(); double W = len.getArea(); System.out.println(L + " " + W);

2018-01-12 20:26:27 185

原创 面向对象——多态2

/* * 接口名 对象名=new 子类(); */ public class polymorphism2 { public static void main(String[] args) { TrueWords t1 = new FenJ(); TrueWords t2 = new MaoTaiJ(); t1.say(); t2.say(); }

2018-01-12 20:24:42 105

原创 面向对象——多态1

/*多态 * 父类 对象名=new 子类(); * 多态中访问成员变量时:编译看父类,运行看子类; * 多态中访问成员方法时:编译看父类,运行看子类 * * */ public class polymorphism1 { public static void main(String[] args) { Wine w1 = new Fen(); Win

2018-01-12 20:23:18 79

空空如也

空空如也

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

TA关注的人

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