Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Java Files

import java.io.File;  // Import the File class
File myObj = new File("filename.txt"); // Specify the filename

/*
canRead() 			Boolean 	Tests whether the file is readable or not
canWrite() 			Boolean 	Tests whether the file is writable or not
createNewFile() 	Boolean 	Creates an empty file
delete() 			Boolean 	Deletes a file
exists() 			Boolean 	Tests whether the file exists
getName() 			String 		Returns the name of the file
getAbsolutePath() 	String 		Returns the absolute pathname of the file
length() 			Long 		Returns the size of the file in bytes
list()		 		String[] 	Returns an array of the files in the directory
mkdir() 			Boolean 	Creates a directory
*/
Comment

PREVIOUS NEXT
Code Example
Java :: java generate uuid 
Java :: Cause: zip END header not found 
Java :: Concept of Association in java 
Java :: Count Occurrences in Seven Integers Using Java Single Dimension Arrays 
Java :: java random int between 2 numbers 
Java :: java how to define a function 
Java :: encapsulation in oop 
Java :: java replace element in list 
Java :: write files with FileOutPutStream java 
Java :: list to map of list java 8 
Java :: java convert float to double 
Java :: heap in java 
Java :: initialize hashmap with values 
Java :: raise error java 
Java :: resize array in java 
Java :: method reference in java 
Java :: java hashcode 
Java :: java instanceof keyword 
Java :: distance point to line java 
Java :: volley android 
Java :: enhanced for loop with arraylist 
Java :: javafx arabic letters 
Java :: java enum 
Java :: android setTextColor not working 
Java :: recursion in java 
Java :: override class java 
Java :: getsource java 
Java :: phone number format java 
Java :: save bitmap file for share on android 10 
Java :: get data from database sqlite android 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =