📄 tij0027.html
字号:
<html><body>
<table width="100%"><tr>
<td>
<a href="http://www.bruceeckel.com/javabook.html">Bruce Eckel's Thinking in Java</a>
</td>
<td align="right">
<a href="tij_c.html">Contents</a> | <a href="tij0026.html">Prev</a> | <a href="tij0028.html">Next</a>
</td>
</tr></table>
<hr>
<H2 ALIGN=LEFT>
Persistence</H2>
<DIV ALIGN=LEFT><FONT FACE="Carmina Md BT" SIZE=3 COLOR="Black">When
you create an object, it exists for as long as you need it, but under no
circumstances does it exist when the program terminates. While this makes sense
at first, there are situations in which it would be incredibly useful if an
object could exist and hold its information even while the program
</FONT><FONT FACE="Carmina Md BT" SIZE=3 COLOR="Black"><I>wasn’t</I></FONT><FONT FACE="Carmina Md BT" SIZE=3 COLOR="Black">
running. Then the next time you started the program, the object would be there
and it would have the same information it had the previous time the program was
running. Of course you can get a similar effect now by writing the information
to a file or to a database, but in the spirit of making everything an object it
would be quite convenient to be able to declare an object
</FONT><FONT FACE="Carmina Md BT" SIZE=3 COLOR="Black"><I>persistent</I></FONT><FONT FACE="Carmina Md BT" SIZE=3 COLOR="Black">
and have all the details taken care of for you.
</FONT><P></DIV><DIV ALIGN=LEFT><FONT FACE="Carmina Md BT" SIZE=3 COLOR="Black">Java
1.1<A NAME="Index49"></A>
provides support for “lightweight persistence,” which means that
you can easily store objects on disk and later retrieve them. The reason
it’s “lightweight” is that you’re still forced to make
explicit calls to do the storage and retrieval. In some future release more
complete support for persistence might appear.
</FONT><a name="_Toc375545206"></a><a name="_Toc408018403"></a><P></DIV>
<div align="right">
<a href="tij_c.html">Contents</a> | <a href="tij0026.html">Prev</a> | <a href="tij0028.html">Next</a>
</div>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -