Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please answer the questions ! JAVA PROGRAMMING ---------------------------------

ID: 3862381 • Letter: P

Question

Please answer the questions ! JAVA PROGRAMMING

--------------------------------------------------------------------------------------------------------------------------

1. It is possible to define two methods with the same name and the same signatures.

1. True

2. False

--------------------------------------------------------------------------------------------------------------------------

2. It is possible for two subclasses to extend a single superclass.

1. True

2. False

--------------------------------------------------------------------------------------------------------------------------

3. The ____ methods allow you to change the value of hidden data fields.

--------------------------------------------------------------------------------------------------------------------------

4. The operator that is used to access a data field of invoke a method from an object is called the ____ operator.

For example:

Circle c;

double r=c.getRadius(); // what is the operator used in c.getRaduius()?

-------------------------------------------------------------------------------------------------------------------------

5. You use the ___ operator to create an object.

-------------------------------------------------------------------------------------------------------------------------

6. Given the class LargeThing with a no-arg constructor,

how would you create an instance of LargeThing named theThing?

<Thank you>

Explanation / Answer

1. It is possible to define two methods with the same name and the same signatures.

true. METHOD OVERIDDING

Only if the two methods are in different class and one class extends the other.

2. It is possible for two subclasses to extend a single superclass.

false. No support for multiple inheritence in java

3. The ____ methods allow you to change the value of hidden data fields.

The Mutator methods, Also known as setter methods

4. The operator that is used to access a data field of invoke a method from an object is called the ____ operator.

Dot operator(.)

5. You use the ___ operator to create an object.

new operator

Scanner object = new Scanner(System.in)

6. Given the class LargeThing with a no-arg constructor,

how would you create an instance of LargeThing named theThing?

LargeThing newObject = new LargeThing(); //call to the default constructor