Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 16 1. 1. This Java package deals with Graphical user interfaces. The original approach used platform specific code for drawing objects, but this package

Question 16 1. 1. This Java package deals with Graphical user interfaces. The original approach used platform specific code for drawing objects, but this package provided a more consistent Java approach to implementing components like buttons, drop down boxes, etc. A. java_graphics B. awt C. swing D. graphics Question 17 1. 1. This low level abstract class is used for writing a stream of bytes A. Writer B. Stream C. OutputStream D. Output Question 18 1. 1. This interface is useful for finding out when a user clicks a button, or hits the Enter key in a JTextField class. A. EnterListener B. TouchListener C. ClickListener D. ActionListener Question 19 1. 1. This class implements a GUI button A. button B. GuiButton C. JButton D. JPushButton Question 20 1. 1. Which of the following is true about the following code 2. 2. A. The program will run and generate the output "RuntimeException" B. The program aborts with an exception C. The program will run and generate the output "Exception" D. The program will run and generate the output "MyError1" E. A compile error at line 11 will occur because doit needs to surround the throw statement with try-catch logic, or change it's declaration to:void doit throws MyError1 Question 21 1. 1. If you add the following statement to your code: addMouseListener( xclass ); Which options are possible for xclass .... check all that apply A. xclass can be an instance of a class which extends MouseAdapter and xclass can override any of the methods in the MouseListener interface. B. If the class that this code lives in implements MouseListener, then xclass can be replaced with the java keyword "this". C. xclass can be an instance of a class which extends the abstract class MouseListener D. xclass can be an instance of an anonymous class which implements MouseListener Question 22

1. 1. In the code below, we get a compile error at line 25. Pick the code which replaces line 25 and fixes this compile error and uses the MyMouseHandler class to process Mouse Clicks. A. this.addMouseListener(); B. MyMouseHandler mmh = new MyMouseHandler(); mmh.addMouseListener(); C. addMouseListener( new MyMouseHandler()); D. addMouseListener(this.JFrame); Question 23

1. 1. In the following code, someone commented out line 18 What are the consequences of having this line commented out? 1. 2. A. A runtime exception will occur when we exit the constructor, because the system will detect an unconnected MouseListener B. The System will throw an "Unhandled Mouse Click" exception when it discovers that the MouseListener is never connected. C. No Compile error or runtime error. However, when our code executes we will not be informed of Mouse clicks. D. A compile error will result once Eclipse discovers that it has a class that implements MouseListener, but this class is never passed to the system. Question 24 1. 1. This is a class which implements the LayoutManager interface and has a philosophy of placing components in rows and columns on the screen where the cell size is the same for all components. A. ScreenGridLayout B. TableLayout C. JPanel D. GridLayout Question 25

1. 1. You can read binary class instances from this Input buffering class. A. FileInputStream B. ObjectInputStream C. DataInputStream D. InputStream Question 26 Implementing this interface makes it possible for a class to have a child process associated with it. A. Serializable B. Thread C. Runnable D. Executable Question 27 1. 1. Calling this method on a thread will allow the thread to begin executing. A. begin B. start C. execute D. runThread Question 28 1. 1. Which statement is true about the following code 2. 2. A. There is a compile error because ObjectOutputStream does not have a constructor which takes a FileOutputStream as it's only parameter. B. This code will not compile unless we catch the "FileNotFoundException" C. This will not compile unless the Data class implements the FileWriteable interface D. A Binary file with the name of file.dat will be created that contains the binary contents of the array "arr" E. A compile error occurs because the Data class does not implement the methods in the Serializable interface Question 29 1. 1. This is a class is a Container for other Components. 2. 2. A. JPanel B. ObjectContainer C. Package D. PackageContainer Question 30 1. 1. This low level abstract class is used for reading a stream of "char"s A. FileReader B. InputStream C. Reader D. FileInputStream Question 31

1. 1. On line 6, what happens if you remove the "implements Serializable" The new line 6 would just be:class Data A. The ObjectOutputStream cannot be written because Data does not implement Serializable. An exception occurs instead. B. A Binary file with the name of file.dat will be created that contains the binary contents of the array "arr" C. There is a compile error because ObjectOutputStream does not have a constructor which takes a FileOutputStream as it's only parameter. D. This code will not compile unless we catch the "FileNotFoundException" E. This will not compile unless the Data class implements the FileWriteable interface Question 32 1. 1. This method is in the Graphics class and is useful for displaying text on a screen 2. 2. A. drawString B. text C. displayString D. drawListener Question 33 1. 1. The _____________ contains a Java package which deals with Graphical user interfaces. The _________ uses the platform code (i.e. specific to PC, Mac, Linux) to implement components like buttons, drop down boxes, etc. Pick the appropriate term to fill in the above blanks. A. Abstract Windowing Toolkit B. Swing software C. Drawing Toolkit D. Bios Question 34 1. 1. All Exception classes and the Error class are derived from this class A. Throwable B. Serializable C. RuntimeException D. Exception Question 35 1. 1. This interface contains no methods. However, implementing this interface in a class makes it possible to write the class to an ObjectOutputStream. A. Comparable B. Serializable C. Streamable D. Writeable

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Understanding Oracle APEX 5 Application Development

Authors: Edward Sciore

2nd Edition

1484209893, 9781484209899

More Books

Students also viewed these Databases questions