20165225 "Java Programming" Nineth Week study summary 1. Video and textbook Learning:
- 13th Chapter Study Summary
The URL class URL object contains three parts of information: protocol, address, and resource creation URL object Two methods: public URL (string spec) throws Malformedurlexceptionpublic URL (string protocol, String host,string file) throws Malformedurlexception uses a string to initialize a URL object url url=new url ("http://www.google.com") InetAddress class method name use Getbyname (String s) to pass a domain name or IP address to a parameter s to get a InetAddress object GetHostName () Gets the domain name contained in the InetAddress object Gethostaddress () Gets the IP address contained in the InetAddress object Getlocalhost () obtains the domain name and IP address socket Datagrampacket class containing the local machine Package the data for packet Datagrampacket (byte data[],int length,inetaddtress address,intport): Contains the data specified by the date array; Port number is on the host of Port Datagrampacket (byte data[],int offset,int length,inetaddtress address,int Port) : Contains the length byte of the array data from the beginning of offset, and the address and port are constructed using the constructor method without parameters Datagramsocket () to create an object that is responsible for sending packets Datagramsocket mail_out=new Datagramsocket (); The object is created, and then the object Mail_out uses the method receive (Datagrampacket pack) to accept the packet remote interface: Requires the remote object to implement the remoting interface in the Java.rmi package, there is no method in its interface, Just an identity action step: Create a datagram to send: Datagrampacket (byte data[],int length,inetaddtress address,int port) or Datagrampack (byte data[] , int offset,int Length,inetaddTress address,int Port) sends datagrams to receive datagrams broadcast datagrams
2. Code hosting:
3. Last week's summary of the wrong title:
周一啦
4. Learning Experience:
20165225 Java programming Nineth Week of study summary