Java 基础知识积累

来源:互联网 发布:em算法实例 编辑:程序博客网 时间:2024/04/30 14:36

1.final 用于声明属性,方法和类,分别表示属性不可变,方法不可重写,类不可继承

2.HTTP协议是无状态的 

3.POJO是一个简单的、正规Java对象,它包含业务逻辑处理或持久化逻辑等,但不是JavaBean、EntityBean等,不具有任何特殊角色和不继承或不实现任何其它Java框架的类或接口。(http://marshzg.javaeye.com/blog/380539)

4.JavaBeans are reusable software components for Java that can be manipulated visually in a builder tool. Practically, they are classes written in the Java programming language conforming to a particular convention. They are used to encapsulate many objects into a single object (the bean), so that they can be passed around as a single bean object instead of as multiple individual objects. A JavaBean is a Java Object that is serializable, has a nullary constructor, and allows access to properties using getter and setter methods.

5.POJO is an acronym for Plain Old Java Object. The name is used to emphasize that the object in question is an ordinary Java Object, not a special object, and in particular not an Enterprise JavaBean (especially before EJB 3).

6.Struts 2 Action 对象为每一个请求产生一个实例,因此没有现成安全问题

7.OGNL(Object Graph Notation Language):它是一种功能强大的表达式语言(Expression Language,简称为EL),通过它简单一致的表达式语法,可以存取对象的任意属性,调用对象的方法,遍历整个对象的结构图,实现字段类型转化等功能。

8.根据条件进行排序,NAME = 'lnstc2'排第一,NAME = '12345'排第二...

SELECT * FROM te_persontarget t

ORDER BY decode(t.NAME,'lnstc2',1,'12345',2);

9.类必须有无参的构造器,才能使用反射机制来创建该对象

10.查看当前文件的编码方式:

Properties p = System.getProperties();

System.out.println(p.get("file.encoding").toString());

原创粉丝点击