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?
[HD Pg 218, Sec. 8.6.2 - javabeans]
Moderator: admin
-
- Posts: 221
- Joined: Mon Nov 26, 2018 2:43 pm
- Contact:
-
- Site Admin
- Posts: 10102
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: [HD Pg 218, Sec. 8.6.2 - javabeans]
No issue. Both are equally valid.
If you like our products and services, please help us by posting your review here.
-
- Posts: 2
- Joined: Sun Apr 21, 2024 10:43 am
- Contact:
Re: [HD Pg 218, Sec. 8.6.2 - javabeans]
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
- 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
-
- Posts: 2
- Joined: Sun Apr 21, 2024 10:43 am
- Contact:
Re: [HD Pg 218, Sec. 8.6.2 - javabeans]
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(), ...
"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
-
- Site Admin
- Posts: 10102
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: [HD Pg 218, Sec. 8.6.2 - javabeans]
- 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
- 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.
Who is online
Users browsing this forum: No registered users and 25 guests