没有合适的资源?快使用搜索试试~ 我知道了~
java实用例子.pdf
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 56 浏览量
2021-10-02
11:47:59
上传
评论
收藏 14KB PDF 举报
温馨提示
![preview](https://dl-preview.csdnimg.cn/27175918/0001-f5f1d7b03253869aaa50545dd1500876_thumbnail.jpeg)
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
试读
15页
java实用例子.pdf
资源推荐
资源详情
资源评论
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![application/pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/release/download_crawler_static/27175918/bg1.jpg)
0 个开发人员非常有用的 Java功能代码
上一篇 / 下一篇 2010-10-13 00:10:24 / 个人分类:转的文章
查看 ( 3697 ) / 评论 ( 29 ) / 评分 ( 55 / 4 )
1. 把 Strings 转换成 int 和把 int 转换成 String
String a = String.valueOf(2);
//integer to numeric string
int i = Integer.parseInt(a); //numeric
string to an int
String a = String.valueOf(2); //integer to numeric string
int i = Integer.parseInt(a); //numeric string to an int
2. 向 Java文件中添加文本
Updated: Thanks Simone for pointing to exception. I have
changed the code.
BufferedWriter ut = null;
try
{
out = new BufferedWriter(new FileWriter( ”
![](https://csdnimg.cn/release/download_crawler_static/27175918/bg2.jpg)
filename ” , true));
out.write( ”
aString ” );
} catch (IOException e) {
// error processing code
} finally
{
if (out != null) {
out.close();
}
}
BufferedWriter ut = null;
try {
out = new BufferedWriter(new FileWriter( ” filename ” , true));
out.write( ” aString ” );
} catch (IOException e) {
// error processing code
} finally {
if (out != null) {
out.close();
}
![](https://csdnimg.cn/release/download_crawler_static/27175918/bg3.jpg)
}
3. 获取 Java现在正调用的方法名
String methodName =
Thread.currentThread().getStackTrace()[1].getMethodName();
String methodName = Thread.currentThread().getStackTrace()[1].getMethodName ();
4. 在 Java中将 String 型转换成 Date 型
java.util.Date =
java.text.DateFormat.getDateInstance().parse(date String);
java.util.Date = java.text.DateFormat.getDateInstance().parse(date String);or
SimpleDateFormat format = new SimpleDateFormat( "dd.MM.yyyy" );
Date date = format.parse( myString );
SimpleDateFormat format = new SimpleDateFormat( "dd.MM.yyyy" );
Date date = format.parse( myString );
5. 通过 Java JDBC链接 Oracle 数据库
剩余14页未读,继续阅读
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/default.jpg!1)
资料大全
- 粉丝: 14
- 资源: 26万+
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)