(2). Everything is an object
- String can be initialized with quoted text.
- There are six different places to store data: registers, the stack, the heap, static storage, constant storage, non-RAM-storage
- You can do everything with a BigInteger or BigDecimal that you can with an int or float.
- When you create an array of objects, you are really creating an array of references, and each of those references is automatically initialized to a special value with its own keyword: null.
- The variable in local scope can not hide the name of global scope, you'll get compile error.
- Java has a garbage collector, which looks at all the objects that were created with new and figures out which ones are not being referenced anymore.
- When a primitive datatype is a member of a class, it's guaranteed to get a default value if you do not initialize it.
- It's best to always explicitly initialize your variables.
- This guarantee doesn't apply to "local" variables --- those that are not fields of a class.
- A problem in any programming language is the control of names.
- The Java creators want to use your internet domain name in reverse since those are guaranteed to be unique.
- Internet domain name mechanism means that all of your files automatically live in their own namespaces.
- Whenever you want to use a predefined class in your program, the compilor must know to locate it.
- Import tells the compiler to bring in a package, which is a library of classes.
- A static method can create or use named objects of its type.
- There is a certain library of classes that are automatically brought into every Java file: java.lang.
- The name of the class is the same as the name of the file.
- One of the better ideas in Java is that writing code isn't the only important activity --- documenting it is at least as important.
- Javadoc allows you to create and maintain a single source file and automatically generate useful documentation. Because of javadoc we have a standard for creating documentation.
- The javadoc will process comment documentation for only public and protected members.
- However, you can use the -private flag to include private members as well.
- The output for the preceding code is an HTML file that has the same standard format as all the rest of the Java documentation.
- You can also use HTML just as you would in any other Web document to format the regular text in your descriptions.
- Don't use headings such as <hl> or <hr> as embedde HTML because javadoc inserts its own headings and you will interere with them.
- The @see tag allows you to refer to the documentation in other classes.
- Javadoc will not check the hyperlinks you give it to make sure they are valid.
- A methord that is marked @deprecated causes the compiler to issue a warning if it is used.