ITM35_F2003_final_key

ITM35_F2003_final_key - ITM352Spring...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
ITM352 Spring 2003 Exam 3- ANSWERS (in bold) Multiple-Choice Questions (2 points each) 1. Which of the following assignments would not be allowed without a typecast? A. assigning  a  short  value to a  long  variable B. assigning  a  byte  value to a  double  variable C. assigning  an  int  value to a  float  variable D. assigning a  double  value to a  long  variable 2. What kind  of event is fired when  the user selects an item from a menu? A. MenuEvent B. CommandEvent C. an  ActionEvent D. UserActionEvent 3. Which of the following  is a container? A. JButton    B.  JLabel C.   JTextArea D.   Jpanel 4. ActionListener  is A. a class B.  an interface C. an instance variable D.  a method 5. The string parameter  to the JButton constructor A. tells which region to put  the button  in B. tells the color of the button C. tells what text will appear on the button D. tells what  should  happen  when  the button  is pressed 6. The simplest layout is A. FlowLayout B.  BorderLayout C.   CardLayout            D.   GridLayout 7. Which method  call would  make the window  myWindow  show  up  on the screen? A. myWindow.setVisible(true); B. myWindow.show(); C. myWindow.display();        D.    myWindow.showWindow(true); 8. A good programming  practice for I/O  in Java is A. have objects do their own I/O B. design a single class to do all I/O  for the program C. avoid file I/O  since it is inefficient D. never append  to a file 9. The classes used  to open a binary file for writing are A. PrintWriter  and   FileOutputStream B. DataOutputStream  and  FileOutputStream C. PrintWriter  and   DataOutputStream D. BufferedWriter  and   DataOutputStream 10. If a new  output  text file cannot be created A. FileNotFoundException  will be thrown 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
B. FileNotCreatedException  will be thrown C. the program  will stop executing with an error message D. the program  will continue  executing and  might produce incorrect results 11. Opening  a text file for writing A. requires use of the  PrintWriter  constructor B. requires use of the  FileOutputStream  constructor C. requires use of the  PrintWriter  constructor and the  FileOutputStream  constructor D. does not require use of any constructors 12. The parameter  to the  Exception  class constructor A. is a  String  that will be the message for the exception B. is an  int  that will be the exception code number C. tells the statement  where execution should  resume D. is a  boolean  telling whether  or not the program  should  terminate 13. catch -blocks are located A. at the beginning  of the method B. at the end  of the method C. before a  try -block D. after a  try -block 14. What determines whether  a method  definition in a derived  class or an ancestor class will be 
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/19/2010 for the course CSIS ITM35 taught by Professor Mike during the Spring '10 term at Grossmont.

Page1 / 7

ITM35_F2003_final_key - ITM352Spring...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online