AP Computer Science 2.5 Classes and Objects
Recommendation
Want a study guide too?
AP Computer Science 2.5 Classes and Objects. Which of the following is not a legal method of call?
AP | AP Computer Science |
AP Computer Science | Classes and Objects |
Computer Science | AP Computer Science |
Language | English Language |
Program Analysis | Algorithm Analysis |
Test Prep | AP Computer Science |
Transcript
Find a people's find o b equals folksy Which of
the following is not a legal method of cough One
eight hundred No Okay here we go And here the
potential answers and roman new rose grows older Walked into
a bar in order to five years Okay here we
go All right Sounds like we're being asked which of
the given method calls are invalid But what on earth
are method calls And when will you ever use them
Are typically a large job project will be split into
separate classes To make code more manageable you might have
one class handling the saving and loading of files Another
class handling networking a class handling graphics and someone that
way When there's a bug in a certain function or
the code needs to be modified All the relevant codes
in one place makes sense right Well the main class
Will then call various methods from other classes as needed
Okay so small programming project may not need so many
separate classes but if things get more complicated well it
helps agree field i think about how a small company
might be just one or two people handling everything in
a garage Well that's perfectly manageable because it's a relatively
small operation with a little work to do but a
large company of dozens or hundreds of people would have
to be split into departments each with different test And
when it's time to do something with same marketing well
you'd have to give him a call Yes hello marketing
department We need to get our name out there and
i'm thinking pigeon sweaters Ooh well well put thousands of
tiny sweaters on pigeons all over the city with a
branding calling elsewhere to make a request is the same
thing we're doing with method calls just with fewer pigeons
Sweater anyhow let's look at our options and figure out
which your invalid option one tries to call of meth
that would object c but see is just a noel
object and hasn't been specified as a new anything option
One won't work at all Option two tries to call
the shed leaves method with object b which looks like
it's gonna work Object b is in book object and
the shed leaves method resides within the low class looking
good options Option three tries to call the shed leaves
method Thanks but object is a pine object with behind
Class doesn't contain a shed leaves method It's only got
shed needles Option three is not going to cut it
That makes our answer D because i'm on one and 00:02:39.42 --> [endTime] three are talent and so are pigeons