Answered step by step
Verified Expert Solution
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 Select 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
Not yet answered
Marked out of
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 Answer
a
polymorphism
b
abstraction
c
information hiding
d
encapsulation
Question
Not yet answered
Marked out of
Flag question
Question text
A access modifier means that the attributemethod is not accessible to anyone outside the class.
Question Answer
a
Protected
b
Package
c
Private
d
Public
Question
Not yet answered
Marked out of
Flag question
Question text
A try statement must be followed by catch or finally blocks.
Question Answer
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started