tester.java
来自「利用Java Socket写的一段通讯协议」· Java 代码 · 共 59 行
JAVA
59 行
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 + =
减小字号Ctrl + -
显示快捷键?