Note of 《thinking in java》2

(2). Everything is an object

  1. String can be initialized with quoted text.
  2. There are six different places to store data: registers, the stack, the heap, static storage, constant storage, non-RAM-storage
  3. You can do everything with a BigInteger or BigDecimal that you can with an int or float.
  4. 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.
  5. The variable in local scope can not hide the name of global scope, you'll get compile error.
  6. 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.
  7. When a primitive datatype is a member of a class, it's guaranteed to get a default value if you do not initialize it.
  8. It's best to always explicitly initialize your variables.
  9. This guarantee doesn't apply to "local" variables --- those that are not fields of a class.
  10. A problem in any programming language is the control of names.
  11. The Java creators want to use your internet domain name in reverse since those are guaranteed to be unique.
  12. Internet domain name mechanism means that all of your files automatically live in their own namespaces.
  13. Whenever you want to use a predefined class in your program, the compilor must know to locate it.
  14. Import tells the compiler to bring in a package, which is a library of classes.
  15. A static method can create or use named objects of its type.
  16. There is a certain library of classes that are automatically brought into every Java file: java.lang.
  17. The name of the class is the same as the name of the file.
  18. One of the better ideas in Java is that writing code isn't the only important activity --- documenting it is at least as important.
  19. 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.
  20. The javadoc will process comment documentation for only public and protected members.
  21. However, you can use the -private flag to include private members as well.
  22. The output for the preceding code is an HTML file that has the same standard format as all the rest of the Java documentation.
  23. You can also use HTML just as you would in any other Web document to format the regular text in your descriptions.
  24. Don't use headings such as <hl> or <hr> as embedde HTML because javadoc inserts its own headings and you will interere with them.
  25. The @see tag allows you to refer to the documentation in other classes.
  26. Javadoc will not check the hyperlinks you give it to make sure they are valid.
  27. A methord that is marked @deprecated causes the compiler to issue a warning if it is used.
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值