摘要:
示例一:package cn.itcast.net.p5.tcptest;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.io.PrintWriter;import java.net.Socket;import java.net.UnknownHostException;public class TransClient {/** * @param args * @throws IOException * @throws UnknownHo. 阅读全文
摘要:
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.net.DatagramPacket;import java.net.DatagramSocket;import java.net.InetAddress;public class UDPSendDemo2 {/** * @param args * @throws IOException */public static void main(String[] args) throws IOEx. 阅读全文
摘要:
接收端:package cn.itcast.net.p2.udp;import java.io.IOException;import java.net.DatagramPacket;import java.net.DatagramSocket;public class UDPReceDemo2 {/** * @param args * @throws IOException */public static void main(String[] args) throws IOException {System.out.println("接收端启动......");/* * 建 阅读全文
摘要:
package cn.itcast.net.p1.ip;import java.net.InetAddress;import java.net.UnknownHostException;public class IPDemo {/** * @param args * @throws UnknownHostException */public static void main(String[] args) throws UnknownHostException {//获取本地主机ip地址对象。 InetAddress ip = InetAddress.getLocalHost();//获取其他. 阅读全文
摘要:
1 public class QuickSort { 2 3 static void sort(int a[],int start,int end) { 4 5 int temp = a[start]; 6 int i = start; 7 int j = end; 8 9 while(i=temp) {11 j--;12 }13 if(i1)27 QuickSort.sort(a... 阅读全文
摘要:
忽略大小写: import java.util.regex.*;class Regex { public static void main(String[] args) { String str = "faaafbbdbddd"; String[] strArry = str.split("(.)\ 阅读全文