Question XXXXXXXXXXTCO 1) Which command compiles the Java source code file Welcome.java? (Points : 6) cd Welcome.java javac Welcome.java java Welcome.java compile Welcome.java Question XXXXXXXXXXTCO...

Question 1. 1. (TCO 1) Which command

compiles the Java source code file Welcome.java? (Points : 6) cd Welcome.java javac Welcome.java java Welcome.java compile Welcome.java Question 2. 2. (TCO 1) What is the default value of a reference variable? (Points : 6) 0 null “ “ default Question 3. 3. (TCO 1) Which of the following is an example of the invocation of a static method in Java? (Points : 6) Integer.parseInt(someString); Math.pow(2, 3); String.format(“This is an output string”); All of the above. Question 4. 4. (TCO 1) Which of the following can be used to get an integer value from the keyboard? (Points : 6) Formatter input = new Formatter(System.in); int value = input.nextInt( ); Scanner input = new Scanner(System.out); int value = input.nextInteger( ); Formatter input = new Formatter(System.out); int value = input.nextNumber( ); Scanner input = new Scanner(System.in); int value = input.nextInt( ); Question 5. 5. (TCO 1) Which of the following is the method used to display a dialog box to gather input? (Points : 6) showMessageDialog getInput inputDialog showInputDialog Question 6. 6. (TCO 1) What do the following statements do? double array[ ]; array = new double[ 14 ]; (Points : 6) Creates a double array containing 13 elements. Creates a double array containing 14 elements. Creates a double array containing 15 elements. Declares but does not create a double array. Question 7. 7. (TCO 2) Static methods of a class (Points : 6) can access all public and private members of the class whether they are static or instance members. are not allowed to access instance members of the class. can access only the protected members of the class. can access all members of every class. Question 8. 8. (TCO 2) What can you say about the following Java class? public class MyApp extends Shape, Color { … } (Points : 6) MyApp will contain methods from both the Shape and Color classes. MyApp will not compile because multiple inheritance is illegal in Java. MyApp inherits from Shape and implements the Color interface. MyApp is allowed to implement both the Shape and Color interface. Question 9. 9. (TCO 3) A JFrame object (Points : 6) displays a standard window with a title bar and minimize, maximize, and close controls. by default breaks the display area into 5 specific regions, each of which can contain 1 GUI component. has an add method which is used to place GUI components into the frame. all of the above. Question 10. 10. (TCO 3) A JPanel is commonly used to (Points : 6) display a window on the computer screen. organize a group of GUI components which share a common layout manager. manage a group of buttons so only one button is on at any time. None of the above. Question 11. 11. (TCO 3) BorderLayout (Points : 6) is a layout manager that organizes components left to right, top to bottom. displays only the last component added to each of its areas. places components around the edges of the display only. cannot be used in a JPanel. Question 12. 12. (TCO 4) What Java package contains the definitions of the Java event listener interfaces? (Points : 6) java.events javax.GUI.events java.event.listener java.awt.event Question 13. 13. (TCO 4) The event driven programming model commonly used to implement Java GUI programs (Points : 6) uses asynchronous events to drive the actions of the program. converts user actions to events which are handled by specific parts of the program. depends on the programmer providing routines to handle specific events which could occur. All of the above. Question 14. 14. (TCO 3) Which of the following is not true for a JTextField? (Points : 6) Can be used to display uneditable text. Can be used to display editable text. Enables users to enter data from the keyboard. Displays a list of fields. Question 15. 15. (TCO 3) Which of the following creates a single line display which is not user editable? (Points : 6) JLabel display = new JLabel(“Enter text”); JTextField display = new JTextField(“Enter text”); JTextArea display = new JTextArea(20, 20); JScrollPane display = new JScrollPane( );





May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here