After creating file using java, there were no values in it -


i have created file using java, following code

string filecontent= "hei"; 

creating file

printwriter writer=new printwriter("d://balanworkspace//coretest//corejavatest//src//intvquestest//mydet3_8.txt","utf-8");  

printing string

system.out.println(filecontent);  

writing file

writer.println(filecontent);  

when opened file, there no values. why so?

you need close printwriter doing this:

writer.close(); 

Comments

Popular posts from this blog

python - Setting ctypes.Structure default values -

Ansible - ERROR! the field 'hosts' is required but was not set -

java - HTTP Status 500 - No data type for node: org.hibernate.hql.internal.ast.tree.IdentNode -