Java 8 String類API 手冊 翻譯 中英文對照

最近在看JAVA8的API英文手冊,瞭解JAVA 8 API的同時也提升下自己的英文文檔閱讀鞥哪裏,基本對照着中文手冊看的,但是看完過一會兒就又忘記了,所以就想着記錄一下。那就寫到博客裏吧。
翻譯的中文基本是從https://www.matools.com/api/java8搬運過來的,只不過拆成了一段話一段話對應的,不需要再打開兩個瀏覽器看了。並且會把高頻單詞列出來

String

// 下面是String類的定義,可以看到String類繼承了Object類,實現了Serializable,Comparable,CharSequence接口

public final class String
extends Object
implements Serializable, Comparable<String>, CharSequence

原文:The String class represents character strings. All string literals in Java programs, such as “abc”, are implemented as instances of this class.
單詞:represents[代表] ,character [字符] ,strings,String [字符串],literals [文字],programs[程序/項目],implemented [實現],instances [實例]
翻譯:String類型代表字符串。JAVA中所有的字符串文字(例如“abc”),都被實現爲這個類的實例

String str = "abc";

原文:is equivalent to:
單詞:equivalent :等效於
翻譯:相當於

char data[] = {'a', 'b', 'c'};
 String str = new String(data);

原文:Here are some more examples of how strings can be used:
翻譯:以下是一些如何使用字符串的示例

System.out.println("abc");
String cde = "cde";
// + 拼接兩個字符串
System.out.println("abc" + cde);
// substring 獲取字符串的子串
String c = "abc".substring(2,3);
String d = cde.substring(1, 2);

原文:The class String includes methods for examining individual characters of the sequence, for comparing strings, for searching strings, for extracting substrings, and for creating a copy of a string with all characters translated to uppercase or to lowercase. Case mapping is based on the Unicode Standard version specified by the Character class.
單詞:examine,examining[檢查]individual[個人],sequence[序列],compare,comparing [比較],extracting[提取],translated [翻譯],map,mapping[映射],specify,specified[指定的],
翻譯:String類包括用於檢查序列的各個字符的方法,用於比較字符串,搜索字符串,提取子字符串和創建一個將所有字符轉爲大寫或小寫的副本。實例映射基於Character類指定的Unicode標準版本。
未完待續…

原文:The Java language provides special support for the string concatenation operator ( + ), and for conversion of other objects to strings. String concatenation is implemented through the StringBuilder(or StringBuffer) class and its append method. String conversions are implemented through the method toString, defined by Object and inherited by all classes in Java. For additional information on string concatenation and conversion, see Gosling, Joy, and Steele, The Java Language Specification.
單詞:concatenation[關聯],operator[操作],conversion[轉換],inherit,inherited[繼承],Specification[規格,說明書]
野生翻譯:Java語言對字符串連接操作和其他對象轉換爲字符串提供了特殊的支持。通過StringBuilder(或StringBuffer)類和他的append方法實現字符關聯。在Java中,通過定義爲Object和繼承所有類的toString方法實現字符轉換。字符串關聯和轉換的其他信息,參閱Gosling, Joy, 和 Steele, Java語言規範。
官方翻譯:Java語言爲連接字符串(+)提供支持,併爲其他對象轉換爲字符串。字符串連接時通過StringBuilder(或 StringBuffer) 類及他的append方法實現的。字符串轉換是通過方法來實現toString,由下式定義Object和繼承所有的類。 有關字符串連接和轉換的其他信息,請參閱Gosling,Joy和Steele, Java語言規範 。

原文:A String represents a string in the UTF-16 format in which supplementary characters are represented by surrogate pairs (see the section Unicode Character Representations in the Character class for more information). Index values refer to char code units, so a supplementary character uses two positions in a String.
單詞:format 【格式】,supplementary【補充】,surrogate 【代理】,pairs 【雙,一副】,section 【部分】,positions 【職位,位置,定位】,refer to 【指,參考】
翻譯:A String 代表utf-16格式的字符串,其中補充字符由代理對錶示(詳細信息請參閱Character 類中Character部分的統一標準)索引值指char代碼單元,因此補充字符在String中使用兩個String

原文:The String class provides methods for dealing with Unicode code points (i.e., characters), in addition to those for dealing with Unicode code units (i.e., char values).

翻譯:String類型提供了處理Unicode 代碼點(即字符)的方法,以及用於處理Unicode代碼單元(即char值)的方法

Field Summary(字段彙總)

Modifier and Type(修飾符和類型) Field and Description(字段和描述)
static Comparator <String> CASE_INSENSITIVE_ORDER
原文:A Comparator that orders String objects as by compareToIgnoreCase.
翻譯:一個比較器按compareToIgnoreCase訂購String對象

單詞
Comparator 【比較器】,fields【字段】,Summary【總結,概要】

Constructor Summary(構造方法摘要)

String
public String()
原文:Initializes a newly created String object so that it represents an empty character sequence. Note that use of this constructor is unnecessary since Strings are immutable.
翻譯:初始化一個新的String對象,以使其示一個空的字符序列。請注意不必要使用此字符序列因爲Strings是不可變的

單詞
Constructor 【構造方法,構造函數,構造器】,immutable【不可變的】

太困了,先睡覺 Zzzz

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章