java修饰符之transient【转贴】
Java语言的关键字,用来表示一个域不是该对象串行化的一部分。当一个对象被串行化的时候,transient型变量的值不包括在串行化的表示中,然而非transient型的变量是被包括进去的
Java代码
class A implements Serializable {
private String name;
transient private String address;
}
那么你在串行化(IO流等)A类时 给它的name和address属性赋值,那么你在提取A时,拿到了name属性,但是却拿不到address属性。
相关文档:
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--每页显示记录条数
@currentpage int output,--第几页
@orderid nvarchar(50),--主键排序
@sort int,--排序方式,1表示升序,0表示降序排列
......
import java.lang.reflect.Array;
public class ReflectionTest {
public static void main(String[] args) {
try {
Example obj = new Example();
j ......
public class FilePath {
public void Print() {
String a = this.getClass().getClassLoader().getResource(".").getPath();
String b = this.getClass().getResource("").getPath();
String c = this.getClass().getResource(" ").getPath();
&n ......
/**
* ==号是比较两个基本类型是否相等,或者比较两个对象引用是否相同
*/
public class T {
public static void main(String[] args) {
Integer i1 = 128;
Integer i2 = 128;
int i3 = 128;
int i4 = 128;
Integer i5 = 127;
Integer i6 = 127; ......
JAVA序列化的两种方式
//大家都知道Serializable是一个mark interface,告诉JVM这个对象可以被转换成二进制流来传输.
//Serializable 在我们实现这个接口的时候,我们可以使用4个私有方法来控制序列化的过程:
//我们来看一个例子:
public class FooImpl implements java.io.Serializable
{
pr ......