Question: When creating a method in a class, you could make the method static if: Question 1 Select one or more: a . It does not

When creating a method in a class, you could make the method static if:
Question 1Select one or more:
a.
It does not use any instance attributes
b.
It needs access to instance attributes
c.
You don't want to create an instance to use the method
d.
You use the this keyword inside the method.
Question 2
Not yet answered
Marked out of 2.00
Flag question
Question text
Assume we have a Java class Music and some subclasses of Music: Jazz, HipHop, and KPop, each of which define a public method play(). We then have some code that defines an array of Music objects, songs, and iterates over that array, for (Music song : songs){ song.play()}. When song is an object of type Jazz, this code calls the .play() method defined in the Jazz class, and when it is an object of type KPop, this same code calls the .play() method defined in the KPop class. This is an example of _____.
Question 2Answer
a.
polymorphism
b.
abstraction
c.
information hiding
d.
encapsulation
Question 3
Not yet answered
Marked out of 1.00
Flag question
Question text
A _________ access modifier means that the attribute/method is not accessible to anyone outside the class.
Question 3Answer
a.
Protected
b.
Package
c.
Private
d.
Public
Question 4
Not yet answered
Marked out of 1.00
Flag question
Question text
A try statement must be followed by _____ catch or finally blocks.
Question 4Answer
a.
zero or one
b.
one or more
c.
zero or more
d.
exactly one

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!