Java Array&String&IO&ENUM
Java Array&String&IO&ENUM
Array
String
IO
ENMU
Reference
Array
Array
ArrayList
add
clear
contains
get
indexOf
remove
size
trimToSize
Sting
String
Comparting
equals & ==
startsWith & endsWith
indexOf & lastIndexOf
substring
concat
valueOf
StringBuild
length
capacity
setLength
ensureCapacity
append
charAt
setCharAt
getCharts
reverse
append
insert
dletet&deleteCharAt
IO
Baisc - Byte&Character Input Output
Byte streams should only be used for the most primitive I/O
Character streams are often "wrappers" for byte streams. The character stream uses the byte stream to perform the physical I/O, while the character stream handles translation between characters and bytes. FileReader, for example, uses FileInputStream, while FileWriter uses FileOutputStream.
in CopyCharacters, the int variable holds a character value in its last 16 bits; in CopyBytes, the int variable holds a byte value in its last 8 bits.
Most of the examples we've seen so far use unbuffered I/O. This means each read or write request is handled directly by the underlying OS. This can make a program much less efficient, since each such request often triggers disk access, network activity, or some other operation that is relatively expensive.
be used for the most primitive I/O
Input
Output
File&Path
ENUM
Enum + Instance field
public enum WhoisRIR {
ARIN("whois.arin.net"),
RIPE("whois.ripe.net"),
APNIC("whois.apnic.net"),
AFRINIC("whois.afrinic.net"),
LACNIC("whois.lacnic.net"),
JPNIC("whois.nic.ad.jp"),
KRNIC("whois.nic.or.kr"),
CNNIC("ipwhois.cnnic.cn"),gg
UNKNOWN("");
private String url;
WhoisRIR(String url) {
this.url = url;
}
public String url() {
return url;
}
}