Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Why is value tied to the entire product experience?

Answered: 1 week ago

Question

8. Demonstrate aspects of assessing group performance

Answered: 1 week ago