1Z0-869 Free Dumps Study Materials
Question 29: Given:
21. TextField tf = new TextField("Memo", "", 50, TextField.ANY);
22. DateField df = new DateField("Date", DateField.DATE_TIME);
23. Form fm = new Form("Form demo");
24. Command cmCount = new Command("Word count", Command.ITEM, 1);
25. Command cmExit = new Command("Exit", Command.EXIT, 1);
26.
27. tf.addCommand(cmCount);
28. fm.append(df);
29. fm.append(tf);
30. fm.addCommand(cmExit);
31. fm.setCommandListener(this);
Which is true?
A. An exception is thrown at runtime.
B. The cmCount and cmExit commands is always available on fm, regardless of which Item is active.
C. Compilation fails.
D. The cmCount command is available only when tf is the active Item.
E. The cmExit command is available only when df is the active Item.
Correct Answer: D