Core Java Volume I - Fundamentals (10th) 1-8章 阅读笔记

001. reasure
[v] say or do something to remove the doubts and fears of someone.

002. website
    http://horstmann.com/corejava

003. deploy
[v] move (troops) into position for military action.

004. hype
[n] extravagant or intensive publicity or promotion.

005. Simply stated, object-oriented design is a programming technique that focuses on the data(= objects) and on the interfaces to that object.

006. The major difference between Java and C++ lies in multiple inheritance, which Java has replaced with the simpler concept of interfaces.

007. On Linux, add a line such as following to the end of your ~/.bashrc or ~/.bash_profile file:
    export PATH=jdk/bin:$PATH

008. jdk-version-docs-all.zip
    www.oracle.com/technetwork/java/javase/downloads

009. The constants Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, and Double.NaN represent these special values, but they are rarely used in practice.

010. Our strong recommentdation is not to use the char type in your programs unless you are actually manipulating UTF-16 code units. You are almost always better off treating strings as abstract data types.

011. A >>> operator fills the top bits with zero, unlike >> which extends the sign bit into the top bits.

012. An enumerated type has finite number of named values. For example:
    enum Size {SMALL, MEDIUM, LARGE, EXTRA_LARGE };

013. Since you cannot change the individual characters in a Java string, the documentation refers to the objects of the String class as immutable.

014. To test two strings are identical except for the upper/lowercase letter distinction, use the equalsIgnoreCase method.
    "Hello".equalsIgnoreCase("hello");

015. intermittent
[adj] occuring at irregular intervals.

016. Sometimes, you need to test that a string is neither null nor empty. Then use the condition
    if (str != null && str.length() != 0)

017. Java™ Platform, Standard Edition 8 API Specification
    https://docs.oracle.com/javase/8/docs/api/

018. The characters in the basic multilingual plane are represented as 16-bit values, called code units. The supplementary characters are encoded as consecutive pairs of code units.

019. StringBuilder appendCodePoint(int cp)
    appends a code point, converting it into one or two code units, and teturns this.

020. venerable
[adj] accorded a great deal of respect, esp. because of age, widsom, or character.

021. The index must immediately follow the %, and it must be terminated by a $. For example,
    System.out.printf("%1$s %2$tB %2$te, %2$tY", "Due date:", new Date());
    Due date: February 9, 2015

022. To read from a file, construct a Scanner object like this:
    Scanner in = new Scanner(Paths.get("myfile.txt", "UTF-8));

023. The continue statement transfers control to the header of the innermost enclosing loop.

024. The enhanced for loop
    for (varivable : collection) statement
sets the given variable to each element of the collection and then executes the statement.

025. culprit
[n] a person who is responsible for a crime or other misdeed.

026. Formally, encapsulation is simply combining data and behavior in one package and hiding the implementation details from the users of the object.

027. UML
Inheritance / Interface implementation / Dependency / Aggregation / Association / Directed association
(Table 4.1)

028. The standard Java library contains two separate classes: the Date class, which represents a point in time, and the LocalDate class, which expresses days in the familiar calendar notation.

029. dissect
[v] methodically cut up (a body, part, or plant) in order to study internal parts.

030. method parameter
A method cannot modify a parameter of a primitive type.
A method can change the state of an object parameter.
A method cannot make an object parameter refer to a new object.

031. The initialization block runs first, and then the body of the contructor is executed.

032. Java uses the keyword super to call a superclass method. In C++, you would use the name of the superclass with the :: operator instead.

033. Recall that the this keyword has two meanings: to denote a reference to the implicit parameter and to call another constructor of the same class. Likewise, the super keyword has two meanings: to invoke a superclass method and to invoke a superclass constructor.

034. smuggle
[v] move(goods) illegally into or out of a country.

035. You can cast only within an inheritance hierarchy.
Use instanceof to check before casting from a superclass to a subclass.

036. Abstract classes cannot be instantitated. That is, if a class is declared as abstract, no objects of that class can be created.

037. Here is a recipe for writing the perfect equals method:
1. Name the explicit parameter otherObject -- later, you will need to cast it to another variable that you should call other.
2. Test whether this happens to be identical to otherObject:
    if (this == otherObject) return true;
3. Test whether otherObject is null and return false if it is. This test is required.
    if (otherObject == null) return false;
4. Compare the classes of this and otherObject. If the semantics of equals can change in subclasses, use the getClass test:
    if (getClass() != otherObject.getClass()) return false;
If the same semantics holds for all subclasses, you can use an instanceof test:
    if (!(otherObject instanceof ClassName)) return false;
5. Cast otherObject to a variable of your class type:
    ClassName other = (ClassName) otherObject;
6. Use == for primitive type fields, Object.equals for object fields.
    return field1 == other.field1
        && Objects.equals(field2, other.field2)
        && ...;
If you redefine equals in a subclass, include a call to super.equals(other).

038. scramble
[v] make one's way quickly or awkwardly up a steep slope or over rough ground by using one's hands as well as one's feet.

039. The wrapper classes have obvious names: Integer, Long, Float, Double, Short, Byte, Character, and Boolean.

040. courtesy
[n] the showing of politeness in one's attitude and behavior toward others.

041. The printf method is defined like this:
    public class PrintStream
    {
        public PrintStream printf(String fmt, Object... args) { return format(fmt, args); }
    }

042. The three classes Field, Method, and Constructor in the java.lang.reflect package describe the fields, methods, and constructors of a class, respectively.

043. Constructor references are just like method references, except that the name of the method is new.

044. ingredient
[n] any of the foods or substances that are combined to make a particular dish.

045. squeamish
[adj] (of a person) easily made to feel sick, faint, or disgusted, esp.

046. An object that comes from an inner class has implicit reference to the outer class object that instantiated it.

047. A static inner class is exactly like any other inner class, except that an object of a static inner class does not have a reference to the outer class object that generated it.

048. Notice that all exceptions descend from Throwable, but the hierarchy immediately splits into two branches: Error and Exception.

049. The code in the finally clause executes whether or not an exception was caught.
InputStream in = new FileInputStream();
try { // code that might throw exceptions }
catch { // show error message }
finally { in.close(); }

050. StackTraceElement[] getStackTrace()
gets the trace of the call stack at the time this object was constructed.

051. suppress
[v] forcibly put an end to

052. A type variable or wildcard can have multiple bounds. For example:
    T extends Comparable & Serializable
The bounding types are separated by ampersands(&) because commas are used to separate type variables.

053. A minimal form of a queue interface might look like this:
public interface Queue<E>
{
    void add(E element);
    E remove();
    int size();
}
Core Java® has long been recognized as the leading, no-nonsense tutorial and reference for experienced programmers who want to write robust Java code for real-world applications. Now, Core Java®, Volume II—Advanced Features, Tenth Edition, has been extensively updated to reflect the most eagerly awaited and innovative version of Java in years: Java SE 8. Rewritten and reorganized to illuminate powerful new Java features, idioms, and best practices for enterprise and desktop development, it contains hundreds of up-to-date example programs—all carefully crafted for easy understanding and practical applicability. Writing for serious programmers solving real-world problems, Cay Horstmann deepens your understanding of today’s Java language and library. In this second of two updated volumes, he offers in-depth coverage of advanced topics including the new Streams API and date/time/calendar library, advanced Swing, security, code processing, and more. This guide will help you •Use the new Streams library to process collections more flexibly and efficiently •Efficiently access files and directories, read/write binary or text data, and serialize objects •Work with Java SE 8’s regular expression package •Make the most of XML in Java: parsing, validation, XPath, document generation, XSL, and more •Efficiently connect Java programs to network services •Program databases with JDBC 4.2 •Elegantly overcome date/time programming complexities with the new java.time API •Write internationalized programs with localized dates/times, numbers, text, and GUIs •Process code with the scripting API, compiler API, and annotation processors •Enforce security via class loaders, bytecode verification, security managers, permissions, user authentication, digital signatures, code signing, and encryption •Master advanced Swing components for lists, tables, trees, text, and progress indicators •Produce high-quality drawings with the Java 2D API •Use JNI native methods to leverage code in other languages If you’re an experienced programmer moving to Java SE 8, Core Java®, Tenth Edition, is the reliable, practical, and complete guide to the Java platform that has been trusted by developers for over twenty years.
Core Java Volume I–Fundamentals, 1 (11th Edition) By 作者: Cay S. Horstmann ISBN-10 书号: 0135166306 ISBN-13 书号: 9780135166307 Edition 版本: 11 出版日期: 2018-09-06 pages 页数: 928 The #1 Java Guide for Serious Programmers: Fully Updated for Java SE 9, 10 & 11 For serious programmers, Core Java, Volume I—Fundamentals, Eleventh Edition, is the definitive guide to writing robust, maintainable code. Whether you’re using Java SE 9, 10, or 11, it will help you achieve a deep and practical understanding of the language and API, and its hundreds of realistic examples reveal the most powerful and effective ways to get the job done. Cay Horstmann’s updated examples reflect Java’s long-awaited modularization, showing how to write code that’s easier to manage and evolve. You’ll learn how to use JShell’s new Read-Eval-Print Loop (REPL) for more rapid and exploratory development, and apply key improvements to the Process API, contended locking, logging, and compilation. In this first of two volumes, Horstmann offers in-depth coverage of fundamental Java and UI programming, including objects, generics, collections, lambda expressions, Swing design, concurrency, and functional programming. If you’re an experienced programmer moving to Java SE 9, 10, or 11, there’s no better source for expert insight, solutions, and code. Master foundational techniques, idioms, and best practices for writing superior Java code Leverage the power of interfaces, lambda expressions, and inner classes Harden programs through effective exception handling and debugging Write safer, more reusable code with generic programming Improve performance and efficiency with Java’s standard collections Build cross-platform GUIs with the Swing toolkit Fully utilize multicore processors with Java’s improved concurrency
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值