目前分類:Java (59)

瀏覽方式: 標題列表 簡短摘要

 

The method list() in the File class can help you to achieve this purpose.

JerryCheng 發表在 痞客邦 留言(0) 人氣()

A meta-character is a characater that has special meaning to a computer program.

for example , in the regular expression engine:

JerryCheng 發表在 痞客邦 留言(0) 人氣()

A sequential file contains records organized by the order where they are entered , 

the length of records and the order of records are fixed.

JerryCheng 發表在 痞客邦 留言(0) 人氣()

We need to use URLConnection class or HttpURLConnection class to set cookie.

The example is as below:

JerryCheng 發表在 痞客邦 留言(0) 人氣()

When we crawl the content from the URL , sometimes the process will become zombie and the task will

be stoped by some internet connection reason.

JerryCheng 發表在 痞客邦 留言(0) 人氣()

In File class , there is a method , mkdir() , which can be used to create directory.
The example is as below:
 
boolean success = (new File("directoryName")).mkdir();
if (!success) 
{
 System.out.println("Directory create failed!!");
}

In File class , it also has another method , mkdirs() , we can use this method if we want to create hierarchical directory .
for example:
This example will create two directory , one is datasets directory , and the other is class_2 directory.
 

String classNum = "datasets\\class_"+2;

JerryCheng 發表在 痞客邦 留言(0) 人氣()

How to retrun a two dimensional array , 

It is very simple in Java , we just need to set the return type as the same as the array tyep.

JerryCheng 發表在 痞客邦 留言(0) 人氣()

有時候 , 我們可能不只有一組data , 而昰有很多組data , 

但是對每組data我們可能會想使用不同的Hashtable , 

JerryCheng 發表在 痞客邦 留言(0) 人氣()

The range of ascii is from 0 to 255 , 

so a character is out of this range , we can say that this character is not a ascii.

文章標籤

JerryCheng 發表在 痞客邦 留言(0) 人氣()

javadoc is a tool in the jdk folder , it can help us transform the comment which was in program

to a documentation which was html style .

JerryCheng 發表在 痞客邦 留言(0) 人氣()

When we write many program , we also need to manage these program in order to avoid confuse.

Java has provide two method for us to manage these program , Package and Jar.

JerryCheng 發表在 痞客邦 留言(0) 人氣()

We can use the method , charAt() , to extract the word in the string.

for example:

JerryCheng 發表在 痞客邦 留言(0) 人氣()

There are three ways to set Classpath.

1. Using command

JerryCheng 發表在 痞客邦 留言(0) 人氣()

The method , delete() , of File class can be used to delete the file.

 

JerryCheng 發表在 痞客邦 留言(0) 人氣()

The method , length() , of File class can be used to get the file size.

File f = new File(fileName);

JerryCheng 發表在 痞客邦 留言(0) 人氣()

The System.out will be changed to test file after the instruction , System.setOut(new PrintStream("test")) ,

is executed.

JerryCheng 發表在 痞客邦 留言(0) 人氣()

We can use File class to open a folder and read the file name of this folder.

and the method , list() , will return an array of strings naming the files in the directory.

JerryCheng 發表在 痞客邦 留言(0) 人氣()

Sometimes , we may want to sent parameter by POST method , 

the following example can help us achieve this purpose.

JerryCheng 發表在 痞客邦 留言(0) 人氣()

String str = "String that you want to transmit";

// Create a socket to the host

JerryCheng 發表在 痞客邦 留言(0) 人氣()


public class QueueTest

JerryCheng 發表在 痞客邦 留言(0) 人氣()

«12 3