File filex=new File("c://1.avi");
URL movieUrl =null;
try
{
movieUrl = filex.toURL();
System.out.println(movieUrl);
} catch (MalformedURLException e3)
{
// TODO 自动生成 catch 块
e3.printStackTrace();
}
我将这个执行,为什么没有在C盘下生成相应的文件啊?
URL movieUrl =null;
try
{
movieUrl = filex.toURL();
System.out.println(movieUrl);
} catch (MalformedURLException e3)
{
// TODO 自动生成 catch 块
e3.printStackTrace();
}
我将这个执行,为什么没有在C盘下生成相应的文件啊?
解决方案 »
- java 子类父类关于静态方法调用
- Java语言本质的一个问题
- 子类继承父类的private,只不过不能使用而已,内存里还是独立存在的....这句话对吗??
- 一个全英文的JAVA题,有人会做吗??
- 在jsp页面使用try catch后的错误
- 关于this用法
- java多线程问题,冰天雪地,挥刀斩臂,规求高人
- 各位进来看看,我这个jar命令有什么不对??????????????????????
- 帮忙看看JCreator2.5和JCreator3.0的编译和运行问题?
- 刚开始研究tomcat-4.0,不知道如何创建tomcat可用的安全证书.
- 一道算术题(java):4~20的floal数值(小数点后四位),0~100的整数作为它的量程同时输出-->a=4的时候b=0,a=20的时候b=100。用什么方法可以打印出中间的数值对。
- 为什么浏览器无法加载呢?
import java.io.*;public class Test{
public static void main(String [] args){
File filex=null;
URL movieUrl =null;
try
{
filex = new File("C:\\jpanseAV.avi");
movieUrl = filex.toURL(); } catch (Exc)
{
// TODO 自动生成 catch 块
e3.printStackTrace();
}
}
}
/*
* $RCSfile: Test.java,v $
* $Revision: 1.1 $
* $Date: 2009-2-28 $
*
* Copyright (C) 2005 Bettem, Inc. All rights reserved.
*
* This software is the proprietary information of Bettem, Inc.
* Use is subject to license terms.
*/package test;import java.io.File;
import java.io.IOException;
/**
* <p>Title: Test</p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2006</p>
* @author lihan
* @version 1.0
*/public class Test { /**
* @param args
*/
public static void main(String[] args) {
File file = new File("c:lihan.txt");
if(!file.exists())
{
try {
file.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}
}}
JAVA的文件追加写入操作测试
if(!file.exists())
{
try {
file.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}