当前位置:网站首页>Use of file class
Use of file class
2022-07-03 07:21:00 【four thousand three hundred and forty-three】
Common constructors :
package File;
import org.junit.Test;
import java.io.File;
public class FileTest {
@Test
public void test1(){
// How to create File Class : Constructor one :
// Relative to current module
// ( Relative paths ) Compared with a certain path
File file1 = new File("hello.txt");
// ( Absolute path ) The path to the file or file directory that contains the drive letter
File file2 = new File("D:\\java project\\day07\\he.txt");
}
@Test
public void test2(){
// Constructors 2:
File file3 = new File("D:\\java project","day07");
// Constructors 3:
File file4 = new File(file3,"hi.txt");
}
}
边栏推荐
- Jeecg menu path display problem
- La différence entre le let Typescript et le Var
- JS date comparison
- Final, override, polymorphism, abstraction, interface
- Warehouse database fields_ Summary of SQL problems in kingbase8 migration of Jincang database
- Crontab scheduled task
- Some experiences of Arduino soft serial port communication
- 4279. Cartesian tree
- Download address collection of various versions of devaexpress
- Le Seigneur des anneaux: l'anneau du pouvoir
猜你喜欢
Interfaces and related concepts
Arduino Serial系列函数 有关print read 的总结
docker建立mysql:5.7版本指定路径挂载不上。
4279. Cartesian tree
Mise en place d'un environnement de développement de fonctions personnalisées
PAT甲级真题1166
JMeter JSON extractor extracts two parameters at the same time
SecureCRT password to cancel session recording
《指環王:力量之戒》新劇照 力量之戒鑄造者亮相
7.2刷题两个
随机推荐
PAT甲级真题1166
[Fiddler actual operation] how to use Fiddler to capture packets on Apple Mobile Phones
SecureCRT取消Session记录的密码
Talk about floating
Distributed lock
Basic knowledge about SQL database
Mise en place d'un environnement de développement de fonctions personnalisées
I. D3.js hello world
Dora (discover offer request recognition) process of obtaining IP address
Operation and maintenance technical support personnel have hardware maintenance experience in Hong Kong
LeetCode
1. E-commerce tool cefsharp autojs MySQL Alibaba cloud react C RPA automated script, open source log
【最詳細】最新最全Redis面試大全(50道)
20220319
Common problems in io streams
File operation serialization recursive copy
Docker builds MySQL: the specified path of version 5.7 cannot be mounted.
C代码生产YUV420 planar格式文件
[Fiddler problem] solve the problem about Fiddler's packet capturing. After the mobile network is configured with an agent, it cannot access the Internet
Advanced API (character stream & net for beginners)