Basic Knowlege points:

1: it's necessary that there is only one public class in per .java file

2: .java file name should better to same as class name

3: when set the environment variable CLASSPATH, you should make sure the '.' path can't be lack of.

4: java is case sensitive, including .java file name , class name, variable name, method name and so on.

5: JVM uses automatic garbage collection machanism. It just collects memory source, not contains physical source, such as database connection, disk IO. You can invoke a collection through call static method System.gc().

6:Java is strong-type language, the variable shouble be declared firstly and then you can use it. ② the vairable only can accept the value which type is consistent with itself.

7: /**   */  is used to add document annotation for java. javadoc command can export the code API document.

8: use '...' follow method parameter type, means has at least one parameter or more parameter. It equals type array type[]. it's similar with params in C#

9. In java, lamda expression use '->' symbol

10. From java 7, switch statement was allow to use String type, before just includes byte, int, char, shot four type.

11.For java, object instance can access the class static method or static field. but in c#, That's illegal.

12. For java, the package is similar with namespace in c#

13. for classes they belongs to same packege, don't have to at the same directory. That means there can be several packages with same name, but these packages should at different directory. And .class file should at the directory which name is same with its package name.

14. in java, 'instanceof' keyword equals 'is' in C#; there isn't  keyword like as 'as'.

15. In Java, support initialization block , don't in c#.

public class A

{

{ ... block }

}

note: the execute order is that: create class object, initialize block, initialize field, constructor

if all class object have same logic, or initialize code, we can use static initialization block

16. In java, final keyword is same as sealed in c#.

17. the relationship of basic type with their packaged class

when convert between basic type with packaged class, system will boxing or unboxing automatically.

18. for value type and reference type which are defined by 'final' keyword', difference is following:

1. final value type can't be changed or modified anymore.

2. final reference type' reference which is pointer address is can't changed, but the object fields can be modified or changed.

Note: it's same as 'readonly' key word and 'const' key word in c#.

19. Object reference:

1. StrongReference ---- when system collect garbage, the object will not be recycled.

2. WeakReference ---- when system collect garbage, the object will be recycled compulsively.

3. PhatomReference  -----  the object will be recycled compulsively. it can't get object address reference use PhatomReference. it just to use to trace the object.

4.SoftReference   ------ when system collect garbage,  if the memory is not enough , the object will be recycled compulsively.

Note: it's alse same as WeakReference in c#

最新文章

  1. 【解决方案】 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userHandler': Injection of resource dependencies failed;
  2. 关于Solr的使用总结的心得体会
  3. Javascript中变量提升的问题
  4. 170多个Ionic Framework学习资源(转载)
  5. malloc/free和new/delete的区别
  6. android图像处理系列之三--图片色调饱和度、色相、亮度处理
  7. C# Flash 图片上传案例(结合网上腾讯头像上传Flash插件)
  8. IFS解惑
  9. 设计模式之八:外观模式(Facade)
  10. css技巧总结
  11. 【Android Developers Training】 12. 支持不同屏幕
  12. Ext.net MessageBox提示
  13. asyncio异步IO——Streams详解
  14. Google瓦片地图URL
  15. 解决SecureCRT无法用非root账号登录ssh
  16. Javascript Canvas验证码
  17. HTML基础学习笔记(1)
  18. django 中 Oauth2 实现第三方登陆
  19. Hive学习之路 (二十一)Hive 优化策略
  20. WPF中的数据驱动

热门文章

  1. js 将long日期格式 转换为标准日期格式方法
  2. 关于PHP 缓冲区
  3. 传说中的华为Python笔试题——两等长整数序列互换元素,序列和的差值最小(修正)
  4. [转]Disabling ASLR on individual iOS applications when using iOS 6.0.1
  5. 我的API HOOK库
  6. 什么是Numpy的ndarray
  7. Ajax实现天气预报功能
  8. Python自动化测试 -ConfigParser模块读写配置文件
  9. Android数据存储汇总
  10. JAVA多线程suspend()、resume()和wait()、notify()的区别