JAVA Question 3: Why would a class be declared as abstract? a. Because it has no
ID: 3582070 • Letter: J
Question
JAVA
Question 3: Why would a class be declared as abstract?
a. Because it has no abstract methods
b. So that it can be used as an interface
c. So that it cannot be inherited from
d. Because it doesn’t make logical sense to instantiate it
Question 4: Which of these classes encapsulate run-time state of an object?
a. Runtime
b. System
c. Cache
d. Class
Question 5: Which of the following statements about anonymous inner classes is FALSE
a. An anonymous inner class CANNOT implement a superclass or interface
b. An "anonymous" inner class is a type of inner class created on the fly with a quick-and-dirty syntax
c. anonymous inner classes are given names like Outer$1, Outer$2 by the compiler
d. Anonymous inner classes are convenient for creating small inner classes
Question 6: Which of these classes is used to create servers that listen for either local or remote client programs?
a. httpServer
b. ServerSocket
c. HttpResponse
d. MimeHeader
Question 7: Which of the following is NOT an example of a framework (Hint: Think inversion of control)
a. An applet
b. Unit Testing using JUnit
c. A simple database program using JDBC
d. GUI using Swing
Question 11: Add the ability to draw a free form curve
a. Model
b. Controller
c. View
Question 12: Modify the application such that selecting a shape and pressing delete would remove the shape
a. View
b. Controller
c. Model
Explanation / Answer
Please follow the data and description :
a)
An abstract class is a class that is declared abstract —it may or may not include abstract methods. Abstract classes cannot be instantiated, but they can be subclassed. When an abstract class is subclassed, the subclass usually provides implementations for all of the abstract methods in its parent class.
So the answer is OPTION D (Because it doesn’t make logical sense to instantiate it).
b)
A class can encapsulate run-time state of an object.
So the answer is OPTION D (Class).
c)
(1) Yes, this statement is incorrect, inner classes are forbidden to have the same name as the enclosing class (4) Yes, this statement is incorrect, anonymous inner classes mayextend a variety of classes.
So the answer is OPTION A and OPTION D.
d)
A server socket waits for requests to come in over the network. It performs some operation based on that request, and then possibly returns a result to the requester.
So the answer is OPTION B (ServerSocket).
e)
A simple database program using JDBC is not a framework.
So the answer is OPTION C ( A simple database program using JDBC).
f)
Model: This corresponds to all the data related logic that the user works with. This can represent either the data that is being transferred between the View and Controller components or any other business logic related data.
View: The View component is used for all the UI logic of the application.
Controller: Controllers act as an interface between Model and View components to process all the business logic and incoming requests, manipulate data using the Model component and interact with the Views to render the final output.
So the answer is OPTION A (Model).
g) So the answer is OPTION B (Controller).
Hope this is helpful.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.