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#

Java learning notes (1):Basic Knowlege points的更多相关文章

  1. Mybatis Learning Notes 1

    Mybatis Learning Notes 主要的参考是博客园竹山一叶的Blog,这里记录的是自己补充的内容 实体类属性名和数据库不一致的处理 如果是实体类的结果和真正的数据库的column的名称不 ...

  2. rt-thread learning notes

    rt-thread learning notes 2018-01-15 > 001 具有相同优先级的线程,每个线程的时间片大小都可以在初始化或创建该线程时指定 rt_thread_t rt_th ...

  3. Java Learning Path(四) 方法篇

    Java Learning Path(四) 方法篇 Java作为一门编程语言,最好的学习方法就是写代码.当你学习一个类以后,你就可以自己写个简单的例子程序来运行一下,看看有什么结果,然后再多调用几个类 ...

  4. Java Learning Path(五)资源篇

    Java Learning Path(五)资源篇 1. http://java.sun.com/ (英文) Sun的Java网站,是一个应该经常去看的地方.不用多说. 2.http://www-900 ...

  5. Java Learning Path(三)过程篇

    Java Learning Path(三)过程篇 每个人的学习方法是不同的,一个人的方法不见得适合另一个人,我只能是谈自己的学习方法.因为我学习Java是完全自学的,从来没有问过别人,所以学习的过程基 ...

  6. Java Learning 001 新建一个Java工程 HelloWorld程序

    Java Learning 001 新建一个Java工程 HelloWorld程序 Step 1 . 在Eclipse 软件里,点击: File -> New -> Java Projec ...

  7. Java Learning 000 搭建开发环境

    Java Learning 000 搭建开发环境 你需要两个软件: * JDK (Java Develop Kit :Java开发工具包) * eclipse (eclipse 集成开发环境软件) 安 ...

  8. Rust learning notes

    Rust learning notes Rust Version 1.42.0 $ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs ...

  9. Coursera, Machine Learning, notes

      Basic theory (i) Supervised learning (parametric/non-parametric algorithms, support vector machine ...

随机推荐

  1. 实现WebService的调用与被调用

    之前一直用WCF来开发服务,可是从未用过WebService.对WebService有种很神奇的期待,都说WebService比较简单,但是从未用过就对我来说就是一种新的知识.起始让我来说WCF与We ...

  2. poj 2184(dp变形,进一步加深01背包)

    点击打开链接 题意: 给你n个物品,每个物品都有两个属性,s和f,要求选择一些物品,使sum(s)+sum(f)最大,并且sum(s)>=0&&sum(f)>=0, 根据0 ...

  3. Dynamics CRM 多个Form显示不同的Ribbon按钮

    昨天群里熊宸(Microfoft MVP)给大家分享了以“Dynamics CRM 客户端编程概况”为主题,在群里给大家做了一次精彩的分享. 一些朋友聊到了Ribbon按钮在Form上的显示问题,因为 ...

  4. vs2012+Spring.Core.dll

    Ⅰ.Spring的点点滴滴--序章   spring是一个轻量级的控制反转(IoC)和面向切面(AOP)的容器框架 .net篇(环境为vs2012+Spring.Core.dll) 新建一个控制台 u ...

  5. ios中判断控制台Log输出控制,是否是iphone5,自动调整尺寸

    // 控制台Log输出控制,此确保在release版本下无Log输出 #ifdef DEBUG #define CMBLOG          NSLog #else #define CMBLOG  ...

  6. 欧几里德算法及其扩展(推导&&模板)

    有关欧几里德算法整理: 1.一些相关概念: <1>.整除性与约数: ①一个整数可以被另外一个整数整除即为d|a(表示d整除a,通俗的说是a可以被d整除),其含义也可以说成,存在某个整数k, ...

  7. 关于grub的那些事(一)

    /etc/default/grub里的秘密: # If you change this file, run 'update-grub' afterwards to update # /boot/gru ...

  8. 企业架构研究总结(40)——TOGAF架构能力框架之架构合同、成熟度模型和架构技能框架

    5. 架构合同 架构合同是在开发团体和赞助者之间关于架构的交付物.质量以及适用目标的联合协议,并且通过有效的架构治理将会促使这些协议的成功施行.通过对合同的管理施行一个治理方法,如下几点将会得到保障: ...

  9. 上传组件uploadify的使用

    上传组件uploadify的使用 大概一年前,我还在用Asp.NET开发一些行业管理系统的时候,就曾经使用这个组件作为文件的上传操作,在随笔<Web开发中的文件上传组件uploadify的使用& ...

  10. js call方法

    js call call 方法 请参阅 应用于:Function 对象 要求 版本 5.5 调用一个对象的一个方法,以另一个对象替换当前对象. call([thisObj[,arg1[, arg2[, ...