51CTO博客开发
1) The java.io package defines I/O in terms of streams, while the java.nio package defines I/O in terms of buffers and channels. The “n” in nio stands for “non-blocking”. The java.net package provides
1) Packages define units of software that can be distributed independently and combined with other packages to form applications. If a type is not declared as being part of an explicit packag
1) The Java virtual machine uses a technique known as garbage collection to determine when an object is no longer referenced within a program, and so can be safely reclaimed to free up memory space.
1) Annoation /?n??te???n/ types present the information in a standard and structured way that is amenable to automated processing by tools. Annotation is centered on types in the package java.la
1) You can create a thread like the following statement: Thread worker = new Thread(); A thread is a thread of execution in a program. The Java Virtual Machine allows an application to have multiple
1) String objects are immutable(read-only), and you have a StringBuilder class for mutable strings. More generally, the java.lang.CharSequence interface is implemented by any class that represents a c
1) All exception types must extend the class Throwable or one of its subclass. There’re two kinds of exceptions in Java: checked exceptions and unchecked exceptions. The Error and RuntimeException cla
1) A switch statement allows you to transfer control to a labeled entry point in a block of statements, based on the value of an expression. The general form of a switch statement is: switch (express
1) Integer division truncates towards zero(7/2=3, –7/2=-3). For integer types, division and remainder obey the rule: (x/y)*y + (x%y) = x So 7%2 = 1, and –7%2=-1. Integer arithmeti
1) The primitive types and their corresponding Wrapper classes’ hierarchy: 2) Given that the wrapper classes are immutable, two objects with the same value can be used interchangeably, and
1) The tokenizer is a greedy tokenizer. It grabs as many characters as it can to build up the next token, not caring if this creates an invalid seuenceof tokens. public class Test { public static voi
1) In Java, an enum is a special kind of class, with an instance that reprsents each value of the enum. Example: enum Card{HEART, DIAMOND, CLUB, SPADE} public class EnumTest { public static void m
Classes’ fields are default to be protected, and the modifier is omitted implicitly. 1) A nested type is considered a part (member) of its enclosing type and the two share a trust relationship in whi
1) An interface can declare three kinds of members: constants(fields) methods nested classes and interfaces All interface members are implicitly public, but, by convention, the publ
1) The collection of methods and fields that are accessible from outside a class, together with the description of how those members are expected to behave, is often referred to as the class's contrac
1) Body mercury; This declaration states that mercury is a variable that can hold a reference to an object of type Body. The declaration DOES NOT create an object. 2)this(...) could be use
Chapter 1 A Quick Tour 1) boolean /?buli?n/ 2) char: 16-bit Unicode UTF-16 character(unsigned) 3) lon
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号