[HD Pg 218, Sec. 8.6.2 - javabeans]

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

Moderator: admin

Post Reply
OCAJO1
Posts: 221
Joined: Mon Nov 26, 2018 2:43 pm
Contact:

[HD Pg 218, Sec. 8.6.2 - javabeans]

Post by OCAJO1 »

If the type of the property is boolean (or Boolean), the name of the getter method may also start with an "is" instead of a "get".

Question,

On the exam - is there a right or wrong answer issue, if a Boolean/boolean getter starts with either one?

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

Re: [HD Pg 218, Sec. 8.6.2 - javabeans]

Post by admin »

No issue. Both are equally valid.
If you like our products and services, please help us by posting your review here.

raphaelzintec
Posts: 2
Joined: Sun Apr 21, 2024 10:43 am
Contact:

Re: [HD Pg 218, Sec. 8.6.2 - javabeans]

Post by raphaelzintec »

hello can you please explain me the technical terms about class because i'm lost with all these terms:

- property
- field
- characteristic
- attribute
- members

it seems that they are all related to everything inside a class: variable, methods, constructors, initializer blocks, inner class

i asked chatgpt and gemini and that's the explanation i got like it's a bit of everything... However i haven't found the exact explanation in the book.

i know it's out of scope for the exam but i wanna know for job interviews

thank you
Last edited by raphaelzintec on Sat May 04, 2024 7:24 pm, edited 1 time in total.
i code with Paul Allen's mix

raphaelzintec
Posts: 2
Joined: Sun Apr 21, 2024 10:43 am
Contact:

Re: [HD Pg 218, Sec. 8.6.2 - javabeans]

Post by raphaelzintec »

btw the person question is very good because i did an non official OCA test at my school and i answeared incorrect... because i got a question like
"what is the correct getter for variable boolean..." and i answeared getBoolean() but correct answear was isBoolean() FOR THEM.

also for boolean they also use getters with "can" such as canSwim(), canEat(), ...
i code with Paul Allen's mix

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

Re: [HD Pg 218, Sec. 8.6.2 - javabeans]

Post by admin »

- property : Please see this: https://docs.oracle.com/javase/tutorial ... rties.html
- field: Any class or instance field.
- characteristic: another term for methods
- attribute: another term for field
- members: fields and methods
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 26 guests