1) What keyword do I use to have a derived class call methods of its base class?
ID: 3585804 • Letter: 1
Question
1) What keyword do I use to have a derived class call methods of its base class?
2) What keyword do I use to inherit from a base class into a subclass?
3) What is the purpose of keyword final? ( 3 responses)
4) Using Java Naming Specifications declare the following with the name “three dimensional area”?(Assume that data types and return types are “double” and access specifiers are “public”:
a) Class
b) function/method
c) Constant
d) variable
5) What is keyword static used for?
6) How often can the state of a constant change.
7) What does an object’s member function read/write the state of?
8) How do I read or write the data associated with the class itself?
9) a)A video game level is designed to accommodate multiple characters’ interactions. Are the attributes of the level best implemented by static or non-static data?
b) What of the characters?
c) If each character has unique items to carry what kind of method would be best to read or alter the state of that attribute (the character’s tools)?
d) If each individual character can contribute to the team’s overall level with their own individual experience, assuming the level is shared for the entire party, would the level of the team be static or non-static data?
e)What of the party members’ individual experience points?
10) In Java’s Object-Oriented environment, what can we use to perform procedural programming?
Explanation / Answer
1) What keyword do I use to have a derived class call methods of its base class?
override
2) What keyword do I use to inherit from a base class into a subclass?
extends
3) What is the purpose of keyword final? ( 3 responses)
final is used for methods that can not be extended, or the values which can not be changed.
4) Using Java Naming Specifications declare the following with the name “three dimensional area”?(Assume that data types and return types are “double” and access specifiers are “public”:
a) Class
public class ThreeDimensionalArea
b) function/method
public void threeDimensionalArea
c) Constant
final double threeDimensionalArea
d) variable
double threeDimensionalArea
5) What is keyword static used for?
static is used for declaring static methods are variables, which do not require an object instance for their operations.
6) How often can the state of a constant change.
Never, constants are not meant to be changed.
7) What does an object’s member function read/write the state of?
the instance variables of the class
8) How do I read or write the data associated with the class itself?
through setter and getter methods
9)
a)A video game level is designed to accommodate multiple characters’ interactions. Are the attributes of the level best implemented by static or non-static data?
non-static
b) What of the characters?
each character should be implemented using an object, the state should be maintained.
c) If each character has unique items to carry what kind of method would be best to read or alter the state of that attribute (the character’s tools)?
non-static
d) If each individual character can contribute to the team’s overall level with their own individual experience, assuming the level is shared for the entire party, would the level of the team be static or non-static data?
static
e)What of the party members’ individual experience points?
private
10) In Java’s Object-Oriented environment, what can we use to perform procedural programming?
static methods
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.