The following solution is suggested to handle the subject “[1] ____ is the principle that allows you to apply your knowledge of a general category…“. Let’s keep an eye on the content below! [1]
____ is the principle a. c. Encapsulation b.
d. Override [2] When you create a [3] By convention, a class a. data c. data type [4] Conventionally, arrows b. UML diagram d. composition [5] The ability to use b.
more secure d. less error prone [6] The class used as a [7] You use the keyword [8] Sometimes the [9] If a programming b. d.
polymorphism [10] ____ [11] When a. Question “[1] ____ is the principle that allows you to apply your knowledge of a general category…”
that allows you to apply your knowledge of a general category to
more specific objects.
Inheritance
Polymorphism
class by making it inherit from another class, you are provided
with data fields and ____ automatically.
diagram contains the ____ following each attribute or method.
field
used in a ____ to show inheritance relationships extend from the
descendant class and point to the one from which it descends.
a. method
diagram
c.
virtual method call
inheritance in Java makes programs easier to write, ____ , and more
quickly understood.
basis for inheritance is the ____ class.
____ to achieve inheritance in Java.
superclass data fields and methods are not entirely appropriate
for
the subclass objects; in these cases, you want to ____ the parent
class members.
language does not support ____ , the language is not considered
object – oriented.
applets
polymorphism is the ability of one method name to work
appropriately for different subclass objects of the same parent
class.
you create a class and do not provide a[n] ____ , Java
automatically supplies you with a default one.
constructor
b.
argument
c. header
d. name
[12]
Usually, the subclass constructor only needs to initialize the ____
that are specific to the subclass.
b.
data
fields
d. constructors
[13] When
you employ ____ , your data can be altered only by the methods you
choose and only in ways that you can control.
a. virtual method
calls c.
information
hiding
b.
polymorphism
d. inlining
[14]
Using the keyword ____ provides you with an intermediate level of
security between public and private access.
a.
protected
b. this
c.
super
d. secure
[15] The
methods in a subclass can use all of the data fields and methods
that belong to its parent, with one exception: ____ members of
the
parent class are not accessible within a child class’s methods.
a. private
b. public
c.
protected
d. final
[16]
You
can use the ____ modifier with methods when you do not want the
method to be overridden.
a.
override
b. access
c.
final
d. end
[17]
Which of the following statements will create a class named Red
that is based on the class Color ?
a. public class Red extends
Color
b.
public Red class extends
Color
c. public Color class expands
Red
d. public extend Red class
Color
[18]
Which of the following statements depicts the valid format to call
a superclass constructor from a subclass constructor?
a. superclass[name,
score];
c. extends[name, score];
b. subclass[name,
score];
d. super[name, score];
[19] If
jrStudent is an object of Student, which of the following
statements will result in a value of true?
a. Student = instanceof
jrStudent
b. jrStudent instanceof
Student
c. instanceof Student =
jrStudent
d. Student instanceof
jrStudent
[20]
Which statement correctly declares a sedan object of the Car
class?
a. sedan Car = new
sedan[];
c. Car sedan = new Car[];
b.
sedan Car = new
sedan[];
d. new sedan[] = Student;
Answer
Answer 1
1] Inheritance
2] Methods
3] Data type
9] Polymorphism
10] Subtype
11] Constructor
12] data fields
13] Information hiding
14] Protected
15] Private
16] Final
17] Red extends Color to public class
18] super[name, score];
19] jrStudent exampleof Student
20] Car sedan = new Car[];
Answer 2
1. Option a. Inheritance allows you to apply what you know about a particular category to specific objects.
2. Option b. Methods
When you create a new class, or make it inherit from another one, the methods and data fields will automatically be inherited.
3. Option c. Data type
A class diagram shows the data type that follows each method or attribute.
4. Option b. UML diagram
The arrows in UML diagram are used to show inheritance relations. They point to the descendant class from which they descend and extend to the descendant.
5. Option d. less error prone
Java’s inheritance feature makes it easier to create programs, reduces error rates, and is easier to understand.
6. Option c. Base class
The base class is the class that serves as a basis to inheritance.
7. Option b. Extend
To achieve inheritance in Java, the keyword extends can be used.
8. Option c. Override
Sometimes, the superclass methods and data fields are not appropriate for subclass objects. In these cases you will want to override parent class members.
9. Option d. polymorphism
A programming language that does not support polymorphism is not object-oriented.
10. Option c. Subtype
Subtype polymorphism refers to the ability for one method name that works correctly for multiple subclass objects of the parent class.
11. Option a. constructor
Java provides a default constructor when you create a class that does not require it.
12. Option b. data fields
Only the subclass constructor needs to initialize data fields specific to the subclass.
13. Option c. Information hiding
Information hiding is a method that allows data to be altered using only the methods you choose, and only in ways you control.
14. Option a. Protected
You can use the protected keyword to provide an intermediate level between private and public access.
15. Option a. private
A child class cannot access the private members of the parent classes.
16. Option c. Final
When you don’t want the method to be ignored, the final is used.
17. Option a. Red extends Color
Here, Color is the base and Red the child classes.
18. Option a. superclass [name, score];
19. Option b. jrStudent instanceof Students
20. Option c. Car sedan = new Car[];
Conclusion
Above is the solution for “[1] ____ is the principle that allows you to apply your knowledge of a general category…“. We hope that you find a good answer and gain the knowledge about this topic of engineering.