This article provides a detailed analysis of file traversal information using the iterator. For more information, see
1. iterate the row of the file
The code is as follows:
Public static IEnumerable
ReadLines (string fileName)
{
Using
ImportJava.io.*;ImportJava.util.regex.Matcher;ImportJava.util.regex.Pattern;/*** Created with IntelliJ idea. * User: KJ a flat * DATE:2015/6/3 * time:15:56 * To change this template use File | Settings | File Templates. */ Public
1. Set Frame (HashSet store string and Traverse)
A:set Collection Overview and Features
View by API
B: Case Demo
HashSet Store strings and traverse
HashSet hs = new HashSet<>();boolean b1 = hs.add("a");
is the IO stream-------------------------------------------------------Instance class:1. Abstract classImport Java.io.File;Import java.io.IOException;Public abstract class Partitionfile {/*** Number of bytes in a single file set*/public static long
Exercise: Copying textPractice requirements: To send a client's file content to the server, on the server side of the data stored in a file. equivalent to copying files.Importjava.io.*;ImportJava.net.*;class txtcopytestclient{ Public Static void
TCP, UDP programming exercisesTCP☆ Upload text fileReads a local text file, sends the data to the server side, and stores the data. After the storage is complete, give the client a hint.first, the idea of solving problemsClient: (1) Create socket
C # garbage collection,
Structure Method:
We know that all reference types have constructor, and there is also a corresponding destructor ). as the name implies, the constructor is the method to be executed when this object is created. For example,
Java Tour (25)--file copy, character stream buffer, Bufferedwriter,bufferedreader, copy file via buffer, readline working principle, custom ReadLine
Let's continue IO for the last space
I. Text copying
Read and write all said,
In the following program, a text file with a line number of filelines is divided evenly into Splitnum small text file, where the newline character ' R ' is on Linux, and Windows's Java line break is ' \ r \ n ': PackageKddcup2012.task2.FileSystem;
This article provides a detailed analysis of file traversal information using the iterator. For more information, see
This article provides a detailed analysis of file traversal information using the iterator. For more information, see
1.
PackageCodecounter;ImportJava.io.BufferedReader;ImportJava.io.File;Importjava.io.FileNotFoundException;ImportJava.io.FileReader;Importjava.io.IOException;ImportJava.util.regex.Matcher;ImportJava.util.regex.Pattern; Public classCodecounter {Static
Students who have developed Web applications should always use the session. Because the HTTP protocol itself is stateless, a client accesses multiple pages of the Web application multiple times, and the server cannot tell if the client is the same
One: Crawl the email address in the webpage
Using regular expressions to match text in a Web page
Copy Code code as follows:
[\\w[.-]]+@[\\w[.-]]+\\. [\\w]+
Split the page content to extract
Import
1, to determine whether the child process execution end
Sometimes after we invoke the shell in Java, the subsequent operation can only continue if the process subprocess ends normally, so we need to determine when the process processes are
Many times, we always access text files in the same way as rows, and using a foreach statement can greatly simplify access logic: for example:
foreach (string line in New Linereader ("C:\abc.txt"))
Console.WriteLine (line);
The complete code is as
[This is my own study notes, welcome reprint, but please specify the source:http://blog.csdn.net/jesson20121020]
Socket Communication:The two programs on the network implement data interaction through a two-way communication connection, one end
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.