Exit 1Z0-869 Java Mobile Edition 1 Mobile Application Developer Certified Professional
Question 1 of 5
0% complete
Q1 Single choice

Given the MIDlet code:

12. File f = new File("myFile.txt");

13. FileOutputStream ds = new FileOutputStream(f);

14. OutputStreamWriter os = new OutputStreamWriter(ds);

15. BufferedWriter buf = new BufferedWriter(os);

16. buf.write('c');

What is the result?

  • A

    The code compiles and runs, and then writes the character c to the file myFile.txt.

  • B

    Compilation succeeds, but an exception is thrown at runtime.

  • C

    Compilation fails because the code uses one or more classes, which are not supported in CLDC 1.1.

  • D

    The code compiles and runs, but line 16 is ignored.

Previous Next