Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 1 Suppose you have three classes in an inheritance hierarchy named: Plane, SmallBiplane, and Biplane. A good inheritance hierarchy would place A. Biplane at

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

QUESTION 1 Suppose you have three classes in an inheritance hierarchy named: Plane, SmallBiplane, and Biplane. A good inheritance hierarchy would place A. Biplane at the top of the hierarchy (highest super class) and Plane at the bottom of the hierarchy (lowest sub-class) B. SmallBiplane at the top of the hierarchy (highest super class) and Plane at the bottom of the hierarchy (lowest sub-class) C. Plane at the top of the hierarchy (highest super class) and SmallBiplane at the bottom of the hierarchy (lowest sub-class) D. Plane at the top of the hierarchy (highest super class) and Biplane at the bottom of the hierarchy (lowest sub-class) E. Biplane at the top of the hierarchy (highest super class) and SmallBiplane at the bottom of the hierarchy (lowest sub-class) QUESTION 2 If Scanner is trying to read in a double using nextDouble and instead receives a string that doesn't represent a valid double, an exception of type [1] is thrown. QUESTION 3 Overloaded methods A. Must have the same return types. B. Can have the same name but must have different return types. C. Have different argument lists and must have a different return type. D. Have different argument lists and, optionally, can have a different return type. E. Must be placed into subclasses. QUESTION 4 The following question addresses Chapter 12 on creating a Java GUI using Scene Builder. Which of the following must be set for a control in Scene Builder in order to create an instance variable in the generated Java code for the controller class? A. text B. OnAction C. fx:id D. layout QUESTION 5 If you create your class and define it as abstract, then A. you will not be able to create instances of this class B. you will not be able to inherit from other classes C. you will not be able to sub-class your program D. you will be able to create Abstract Data Types from your program E. you will not be able to access your program outside of the current package Instance variables are almost always assigned an access modifier of QUESTION 8 Suppose you create a class called Rectangle which includes an instance variable called height. How many copies of this variable exist in RAM if you create 20 objects of this class? A. 20 B. 1 C. none D. 40 E. The number cannot be determined. QUESTION 9 When the system picks which function definition to use at run time, it is called: QUESTION 10 If the class header looks like this: public class MyProg extends M A. then you know you have an application. B. then you know you have an Abstract Data Type. C. then you know that class MyProg has a no-arguments constructor. D. then you know M is the super class for MyProg. E. then you know you will need at least one import statement. QUESTION 11 If you make a method type final then A. you will not be able to "see" it from a subclass B. you will not be able to access it from another class C. you will not be able to execute it using an instance of this class D. you will not be able to override it in a subclass E. the operating system decides what you can do with this method QUESTION 12 A try statement can have multiple catch blocks to handle various types of exceptions. True False QUESTION 13 In Chapter 12, event handlers are discussed. Describe the purpose of an event handler and provide a specific example of its use (no code required in your answer). For the toolbar, press ALT+F10 (PC) or ALT+FN+F10 (Mac). QUESTION 14 Show the Java code required to create a public abstract method called regisfer() which takes one parameter of type String called studentiD. This method should have a return type of boolean. For the toolbar, press ALT+F10(PC) or ALT+FN+F10 (Mac). QUESTION 15 If you want to create a constant (of type double) called weight in your Java program, you should use the following declarartion statement: A. final double WEIGHT, B. final const double WEIGHT, C. constant double WEIGHT, D. Double WElGHT; E. const DOUBLE WEIGHT; QUESTION 16 In Java "this" is. A. a reference to The current method. B. a reference to the current instance variable. C. a reference to the current ADT. D. a reference to the current object. E. a reference to the current information being hidden. QUESTION 17 Show the Java code required to load up the FXML file named AccountUpdate.fxml. Hint; This step uses the FXMLLoader class and loads up the FXML file that represents the GUI. For the toolbar, press ALT+F10 (PC) or ALT+FN+F10 (Mac). QUESTION 18 All fields of an abstract class are implicitly (automatically) defined as public and abstract. True False QUESTION 19 In the TipCalculator project, the code steps to handle events are specified in the file. A. TipCalculator.fxml B. TipCalculator.java C. TipCalculatorController.java D. Application.java QUESTION 20 The two types of exceptions in Java are and_2. QUESTION 21 If you create a class and do not provide a constructors for your class, then A. Your program will not compile. B. You must always pass arguments to your constructor method. C. Your Abstract Data Type will not execute. D. You will only be able to use a no-arguments constructor provided by Java. E. You must declare your Abstract Data Type to be type "abstract" QUESTION 22 Super classes have direct access to the public members of the sub class True False QUESTION 23 You cannot inherit from more than one class in Java True False QUESTION 24 Which of the following method headers will throw an Exception? public static void CalculateTotal() throw new Exception public static void CalculateTotal() throw Exception public static void CalculateTotal() throws Exception public static void CalculateTotal() throws new Exception() QUESTION 25 To execute the no-arguments constructor method belonging to the parent class, use A. super( ); B. toString.super(); C. super.toString(); D. this.MyClass(); E. super.construct()

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

AWS Certified Database Study Guide Specialty DBS-C01 Exam

Authors: Matheus Arrais, Rene Martinez Bravet, Leonardo Ciccone, Angie Nobre Cocharero, Erika Kurauchi, Hugo Rozestraten

1st Edition

1119778956, 978-1119778950

More Books

Students also viewed these Databases questions

Question

What were your most important educational experiences?

Answered: 1 week ago

Question

How do Data Types perform data validation?

Answered: 1 week ago

Question

How does Referential Integrity work?

Answered: 1 week ago