⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tester.java

📁 利用Java Socket写的一段通讯协议
💻 JAVA
字号:
package com.ict.netcom2.trash;

import java.nio.*;
import java.util.*;

public class Tester {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		byte[] b= new byte[2];
		b[0] = 0;
		b[1] = 0;
		
		A a = new A();
		a.i = 1;
		
		a = new B();

		HashMap<String,Integer> map = new HashMap<String,Integer>();
		map.put("123", 123);
		map.put("123", 321);
		
		
		System.out.println(map.get(new String("123")));
		
		String str = "1 2 3 4 5 ";
		String[] nidaye = str.split(" ");
		for (int i=0; i<nidaye.length; i++)
			System.out.println(nidaye[i]);
	}
	
	static void change(byte[] b) {
		b[0] = 1;
	}
	
	public static void read1(ByteBuffer buf) {
		System.out.println(buf.get());
		read2(buf);
	}
	
	public static void read2(ByteBuffer buf) {
		System.out.println(buf.get());
	}
}

class A {
	int i;
}

class B extends A{
	int j = -1;
	
	public B() {
		this.i = super.i;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -