Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. The behavior of an object is described by its __________. a. Data Fields b. Constructor c. Constants d. Methods 2. To encapsulate class, you

1. The behavior of an object is described by its __________.
a. Data Fields
b. Constructor
c. Constants
d. Methods
2. To encapsulate class, you should mark all data fields __________ and provide get methods
and set methods to access the data.
a. abstract
b. private
c. static
d. public
3. Which one of the following cannot be inherited by sub classes?
a. Superclasss Methods
b. Superclasss Data Fields
c. Superclasss Constructors
d. Superclasss Abstract methods
4. Which of the following statement is TRUE about equals method?
a. It compares the names of two objects.
b. It compares the contents of two objects.
c. It compares the references of two objects.
d. None of the above
5. Given:
ArrayList list = new ArrayList();
Which of the following type cannot be used to replace E ?
a. int
b. Integer
c. Double
d. String
6. Which of following statements is TRUE about Exceptions?
a. finally block will execute only if there is an exception in try block.
b. finally block will execute only if there is an exception in try block and not caught in a
catch block.
c. finally block will execute only if there is no an exception in try block.
d. finally block will execute whether there is an exception in try block or not.
Colleges of Applied Sciences ITDR2104 Programming - Final Exam - Spring 2018 Page 2 of 13
7. Which of following statements is TRUE about Abstract Classes?
a. An abstract method can be contained in a non-abstract class.
b. When a subclass extends an abstract class, all the abstract methods in the superclass must
be implemented or it must be declared abstract.
c. An abstract class can be instantiated using the new operator.
d. It is not possible to define an abstract class that contains no abstract methods.
8. Let n be an Integer object, which one of the following expressions will evaluate to false?
a. n instanceof Integer
b. n instanceof Object
c. n instanceof Comparable
d. n instanceof String
9. The File class has a method to ____________.
a. check whether the file exist or not
b. read data from a file
c. write data to a file
d. replace data in a file
10. A single entity with too many responsibilities can be broken into several classes to separate
responsibilities. This class design guideline can be categorized under ____________.
a. Consistency
b. Coherence
c. Encapsulation
d. Completeness
11. Assume a Student class has a data field called admissionYear and you want to know the
number of years a student has completed in the college. Which of the following would be the
best approach to do that?
a. Declare a new data field numberOfYearsInCollege.
b. Replace data field admissionYear with data field numberOfYearsInCollege.
c. Calculate the number of years in college from the existing data field admissionYear.
d. Do not change anything in the Student class, and introduce a new class to handle the
number of years in college.
12. FlowPane arranges its children ____________.
a. horizontally from left to right.
b. vertically from top to bottom.
c. in five different regions.
d. in multiple rows or multiple columns.
13. Which of following statements is TRUE about JavaFX Ellipse class?
a. Ellipse has two different radiuses, radiusX and radiusY.
b. Ellipse has to one central point.
c. Ellipse extends the class Circle.
d. Ellipse has width and height data fields.
Colleges of Applied Sciences ITDR2104 Programming - Final Exam - Spring 2018 Page 3 of 13
14. The interface EventHandler for any event class contains one of the following
methods for handling the events _________.
a. actionEvent(T e)
b. mouseEvent(T e)
c. handle(T e)
d. handleEvent(T e)
15. Which of the following is NOT true about inner class?
a. It is defined outside the scope of another class.
b. It can reference data defined in its outer class.
c. It can reference methods defined in its outer class.
d. You do not need to pass the reference of outer class to the constructor of the inner class.
16. Which of the following controls enables the user to choose a single value or multiple values?
a. RadioButton
b. CheckBox
c. ListView
d. ComboBox
17. Which one of the following alerts is used to inform the user that something has gone wrong?
a. Information
b. Error
c. Warning
d. Confirmation
18. _____ is a regular menu, but does not have a menu bar and can float anywhere on the screen.
a. Menu
b. MenuBar
c. ContextMenu
d. SeparatorMenuItem
19. The Animation class provides the core functionality for all animations. Which one of its
subclasses is used to animate the change of opacity in a node over a given time?
a. PathTransition
b. FadeTransition
c. TimeLine
d. OpacityTransformation
20. Which of the following classes you can used to mute and control the volume of a media?
a. Media
b. MediaPlayer
c. MediaView
d. MediaControl

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_2

Step: 3

blur-text-image_3

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

Datacasting How To Stream Databases Over The Internet

Authors: Jessica Keyes

1st Edition

007034678X, 978-0070346789

More Books

Students also viewed these Databases questions