| |
真爱的事业和真正的爱情一生只有一次,都值得我们温柔地相待,因为那种感觉是永远都无法复制的, 这世界真正属于你的东西其实并不多,你不好好珍惜,它便会离你而去,包括机遇,包括爱情,包括生命。 不要找任何理由, 当幸福在你身边的时候就抓住它,你就一定会很幸福! |
| 时 间 记 忆 |
| « | April 2026 | » | | 日 | 一 | 二 | 三 | 四 | 五 | 六 | | | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | | | |
|
blog名称:玻璃杯中的花生壳 日志总数:162 评论数量:249 留言数量:1 访问次数:844651 建立时间:2004年11月4日 |
 | | |
|
| |
Question No: 1
1.public class test ( 2. public static void main (String args[]) { 3. int i = 0xFFFFFFF1; 4. int j = ~i; 5. 6. } 7. ) What is the decimal value of j at line 5? A. 0 B. 1 C. 14 D. –15 E. An error at line 3 causes compilation to fail. F. An error at line 4 causes comp |
|
Question No: 1
public class test ( 2. public static void main (String args[]) { 3. int i = 0xFFFFFFF1; 4. int j = ~i; 5. 6. } 7. ) What is the decimal value of j at line 5? A. 0 B. 1 C. 14 D. –15 E. An error at line 3 causes compilation to fail. F. An error at line 4 causes |
|
null对象与static成员变量
1. class MyClass { 2. static String myName = "SCJP"; 3. 4. MyClass getMyClass() { 5. System.out.println(myName); 6. &nbs |
|
Date date=new Date(); SimpleDateFormat dateFmt=new SimpleDateFormat(); dateFmt.applyPattern("yyyy-mm-dd"); date=dateFmt.parse(this.activity_time); |
|
Java 对文件进行读写操作的例子很多,让初学者感到十分困惑,我觉得有必要将各种方法进行 一次分析,归类,理清不同方法之间的异同点。
一.在 JDK 1.0 中,通常是用 InputStream & OutputStream 这两个基类来进行读写操作的。 InputStream 中的 FileInputStream 类似一个文件句柄,通过它来对文件进行操作,类似的,在 OutputStream 中我们有 FileOutputStream 这个对象。
用FileInputStream 来读取数据的常用方法是: FileInputStream fstream = new FileInputStream(args[0]); DataInputStream in = new DataInputStream(fstream); 用 in.readLine() 来得到数据,然后用 in.close() 关闭输入流。 完整代码见 Example 1。
用FileOutputStream 来写入数据的常用 |
|
在用java编写文件处理程序时发现一个奇怪的现象:java中写文件操作是可以使用FileOutputStream()和FileWriter()两种方法,但是两种方法产生的结果却不同。
方法一:使用FileOutputStream(),每次程序运行后会产生一个新的文件,如果这个新的文件在相同目录下已经有同名文件存在,则覆盖掉该文件,只显示本次执行的结果。
eg:FileOutputStream resultsFile = new FileOutputStream("C:\\result.txt"); PrintStream toFile = new PrintStream( resultsFile );
output: <BEGIN> type: data |
|
以前写过一个java中对文件的操作(http://dev.csdn.net/develop/article/19/19064.shtm),但是不全,就把剩下的一些加到评论里边了,但这次改版以后评论里的就看不到了,我就重新贴一下。
10。按行读文件 <%@ page contentType="text/html; charset=gb2312" %> <%@ page import="java.io.*" %> <% FileReader myFileReader=new FileReader("c:/哈哈.txt"); BufferedReader myBuffere |
|
网络程序的很大一部分是简单的输入输出,即从一个系统向另一个系统移动字节。字节就是字节,在很大程度上,读服务器发送的数据与读取文件没什么不同;向客户传送数据与写入一个文件也没有什么区别。
Java中输入和输出组织不同于大多数其他语言。它是建立在流(stream)上。不同的基本流类(
| | |
|
项目小结(hibernate + spring + webwork)
目前情况:
自动工单管理系统,使用自开发的类似struts
| | |
|
嘿嘿,偶来介绍下Webwork2结合Spring, Hibernate,Default认为对Spring,Hibernate有一定了解。 从User说起,包括创建/修改/删除User,以及对User的列表,先看Webwork2的Action代码 为简单说明问题,不考虑什么Interceptor, Duplicated Submit, Validation,等问题
创建/修改/删除User:UserAction.java相关代码
java代码:
< |
| | | |
|