About Question enthuware.ocajp.i.v8.2.1448 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
prasanna_ls
Posts: 7
Joined: Wed Nov 11, 2015 11:59 pm
Contact:

About Question enthuware.ocajp.i.v8.2.1448 :

Post by prasanna_ls »

Do objects have behavior? Objects only have a state, right? Objects don't have the methods within themselves as far as I understand. They only have instance variables. They pass "this" along with the parameters to the methods which are in.... the Class class? Or the Class Object? I'm really confused here :?

prasanna_ls
Posts: 7
Joined: Wed Nov 11, 2015 11:59 pm
Contact:

Re: About Question enthuware.ocajp.i.v8.2.1448 :

Post by prasanna_ls »

Also, it's valid to say Classes can be reused. But is it valid to say that objects can be reused? As mentioned in the explanation, it is very ambiguous. "One can certainly call methods on the same object again and again." But that is just normal use right? There isn't any reuse there. Maybe they're referring to the String intern pool? The String objects there can certainly be reused.

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocajp.i.v8.2.1448 :

Post by admin »

prasanna_ls wrote:Do objects have behavior? Objects only have a state, right? Objects don't have the methods within themselves as far as I understand. They only have instance variables. They pass "this" along with the parameters to the methods which are in.... the Class class? Or the Class Object? I'm really confused here :?
Classes define the behavior but it is the objects that behave. For example, the Dog class may define a behavior named eat or bark. But it is an actual Dog object that will eat or bark.

HTH,
Paul.
If you like our products and services, please help us by posting your review here.

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocajp.i.v8.2.1448 :

Post by admin »

prasanna_ls wrote:Also, it's valid to say Classes can be reused. But is it valid to say that objects can be reused? As mentioned in the explanation, it is very ambiguous. "One can certainly call methods on the same object again and again." But that is just normal use right? There isn't any reuse there. Maybe they're referring to the String intern pool? The String objects there can certainly be reused.
Right. That is why this option is too vague and ambiguous.
If you like our products and services, please help us by posting your review here.

flex567
Posts: 202
Joined: Mon Apr 02, 2018 8:40 am
Contact:

Re: About Question enthuware.ocajp.i.v8.2.1448 :

Post by flex567 »

From the explanation:
This is not true because Java does have primitives as well (byte, short, char, int, long, float, double, boolean), which are not Objects.
Interfaces are also not objects.

Post Reply

Who is online

Users browsing this forum: No registered users and 40 guests