Hi,

I was using booleans earlier in my class.
--> isProductRestricted
--> internal
--> isProductGlobal

I am using lombok too. So putting @Data at the top of class too. But, now I changed these boolean to Boolean variable.
I got errors where ever Object.isInternal() was used. I am not getting how isInternal() was working initially. There is no function in my class too.

Also, I am able to access boolean isProductGlobal using Object.getProductGlobal() bit there is "is" also attached to the productGlobal name. Can you please explain this? How is it happening here?

Thanks in advance.

Re: Does Java creates "is" functions for booleans in a class? 80 80

You seem to be calling those methods as if they were class methods for the Object class... which they're not.

Re: Does Java creates "is" functions for booleans in a class? 80 80

No. NOt object class. Consider it as like this:

MyClass myClass = new MyClass();

myClass.isInternal()
myClass.getProductGlobal()
Re: Does Java creates "is" functions for booleans in a class? 80 80

OK, it's just that you used Object in your first post

When you say "got errors", exactly what error messages do yu see?

Re: Does Java creates "is" functions for booleans in a class? 80 80

Thanks for your quick response.
Yes. By errors, I meant that they are not defined any more. This happened when I changed boolean to Boolean. I suspect this happens because of lombok.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.