Which two errors are available in CLDC? (Choose two.)
Which two errors are available in CLDC? (Choose two.)
Given:
1 1. HttpsConnection c = (HttpsConnection)
Connector.open("https://www.mywebserver.com");
1 2. int portNumber = c.getPort();
What is the value of the portNumber variable after executing the code?
Given:
1 4. Canvas canvas;
1 5. // ...
2 4. canvas.repaint(10,10,20,20);
2 5. canvas.serviceRepaints();
What occurs when serviceRepaints() is called?
Given the MIDlet code:
1 2. File f = new File("myFile.txt");
1 3. FileOutputStream ds = new FileOutputStream(f);
1 4. OutputStreamWriter os = new OutputStreamWriter(ds);
1 5. BufferedWriter buf = new BufferedWriter(os);
1 6. buf.write('c');
What is the result?
Given a class named MyCanvas, which three CANNOT be used if MyCanvas is a direct subclass of Canvas? (Choose three.)
What is guaranteed by CLDC regarding time zones?
Given:
A record store has three records: Record 1 contains Apple, Record 2 contains Mango, Record 3 contains Cherry, and the RecordComparator class:
1 . public class CompareTest implements RecordComparator {
2 . public int compare(byte[] rec1, byte[] rec2) {
3 . String str1 = new String(rec1), str2 = new String(rec2);
4 . int result = str2.compareTo(str1);
5 . if (result == 0)
6 . return RecordComparator.EQUIVALENT;
7 . else if (result < 0)
8 . return RecordComparator.PRECEDES;
9 . else
1 0. return RecordComparator.FOLLOWS;
1 1. }
1 2. }
What is the return order of the records for an enumerator using CompareTest?
Given:
1 . import javax.microedition.midlet.*;
2 . public class Foo extends MIDlet {
3 . public void go() {
4 . ThreadGroup x = Thread.currentThread().getThreadGroup();
5 . int numThreads = x.activeCount();
6 . Thread[] threads = null;
7 . x.enumerate(threads);
8 . }
9 . public void destroyApp(boolean b) { }
1 0. public void pauseApp() { }
1 1. public void startApp() { }
1 2. }
What is the result?
Given the MIDlet code:
1 1. public void startApp() {
1 2. Form f = new Form("hello");
1 3. Display.getDisplay(this).setCurrent(f);
1 4. System.gc();
1 5. System.exit(0);
1 6. f.append("foo");
1 7. }
What is the result?
The developer is designing a game that uses the LayerManager and Sprite classes. Three Sprite objects are added to a LayerManager object and a call is placed to the LayerManager.paint(Graphics, x, y) method. In what order are the Sprite objects rendered to the device display?
What is the minimum number of simultaneously running threads that a JTWI 1.0 device must support for each MIDlet suite?
Click the Exhibit button. Which two are true? (Choose two.)
