摘要:
1packagecom.io.test;23importjava.io.FileNotFoundException;4importjava.io.FileReader;5importjava.io.FileWriter;6importjava.io.IOException;78importorg.junit.Test;910publicclassTestFileReaderAndWriter{11@Test12publicvoidtestFileReader(){13try{14FileReaderfr=newFileReader("E:/1.txt");15intln=0 阅读全文
摘要:
1packagecom.io.test;23importjava.io.FileInputStream;4importjava.io.FileNotFoundException;5importjava.io.FileOutputStream;6importjava.io.IOException;78importorg.junit.Test;910publicclassTestFileStream{1112@Test13publicvoidtestFileInputStream(){14try{15FileInputStreamis=newFileInputStream("E:/1.t 阅读全文
摘要:
1packagecom.test;23importjava.io.BufferedReader;4importjava.io.File;5importjava.io.FileReader;6importjava.io.IOException;7importjava.util.ArrayList;8importjava.util.Iterator;9importjava.util.LinkedHashMap;10importjava.util.List;11importjava.util.Map;1213publicclassFileReadTest{14privatestaticBuffere 阅读全文
摘要:
1packagecom.test;23publicclassPerson{45privateStringid;6privateStringname;78publicStringgetId(){9returnid;10}1112publicvoidsetId(Stringid){13this.id=id;14}1516publicStringgetName(){17returnname;18}1920publicvoidsetName(Stringname){21this.name=name;22}2324@Override25publicinthashCode(){26intresult;27 阅读全文
摘要:
1packagecom.socket.udp;23importjava.io.ByteArrayInputStream;4importjava.io.ByteArrayOutputStream;5importjava.io.DataInputStream;6importjava.io.DataOutputStream;7importjava.io.IOException;8importjava.net.DatagramPacket;9importjava.net.DatagramSocket;10importjava.net.InetSocketAddress;11importjava.net 阅读全文