Professional Documents
Culture Documents
1)Scanner class
2)BufferReader
File handling:
To store the data in the file we have to WRITE (write) method .we have to pass data
to store the data we have to create writeUTF ..whatever you want to store the data
writeUTF method belongs to Dataoutputstream . so we have to create the object.
there might be some promblem to crate those file demo.txt or some problem might be
writeUTF so we will give error so we have to handle those error through try and
catch or throws exception
so file will be successful .it is encrypted formate. so open with word file
read this content we have to say method called name readUTF. it returns the string
to retrive the data we have to create datainputstream.same as like dataoutputstream
like wise fileinputstream no obj create karvano
to read the data first which file we have to read so first we declare using
fileinputstream
retrive the data using datainputstream and storing and convertdata into string and
print it
File f=new file("File name");//why we can use because i here two time we can write
file name but what if i want to change file name i have to write 2 times . so ana
karta file no object create karine
obje pass kari nakhvano so file name change karvano hoy to khali 1 time j lakhvu
pade..
properites files:when you work on project you need some configuration or files.like
spring,hibernate...
we have to use xml file but some people work on properties file
in one file we have multiple key and multiple values
fetch the data we can use InputStream . and load the file and print the data and
method we can use getProperty("url/password/uname");
File Management :