Answer to Question #52580 in Java | JSP | JSF for Milini

Question #52580
3. Write a program to create a file Unicode.dat which contains rows of unicode
characters with their code number equivalent, starting at 27 and finishing with
125. If the program runs successfully, the only message your program prints on
screen is “Output file has been created: Unicode.dat’ but opening the file
shows the output below.
1
Expert's answer
2015-05-13T03:10:19-0400
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

/**
*
*/
public class Unicode {
public static void main(String[] args) {
final String filename = "Unicode.dat";
try {
FileWriter fw = new FileWriter(new File(filename));
for (int i = 27; i <= 125; i++) {
fw.write((char) i + " " + i + "\n");
}
fw.close();
System.out.println("Output file has been created: Unicode.dat");
} catch (IOException e) {
e.printStackTrace();
}
}
}


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS