File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Boolean vs boolean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Boolean vs boolean" Watch "Boolean vs boolean" New topic

Boolean vs boolean

Melinda Wilson
Ranch Hand

Joined: Jul 05, 2001
Posts: 35
Can someone help me understand why I have an error that says "Type mismatch cannot convert from Boolean to boolean".
Confused about Boolean and boolean.
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
A boolean is a primitive. A Boolean is an object that does nothing other than hold a boolean so you can deal with those things that are so picky that they only hold Objects.

"JavaRanch, where the deer and the Certified play" - David O'Meara
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
I am assuming you have a Boolean that you need to get into a boolean. You can use the booleanValue method in the Boolean class. It takes a Boolean object and returns the value of it as a boolean. Something like this:

hope that helps

did I say boolean/boolean enough in that post?

I agree. Here's the link:
subject: Boolean vs boolean
It's not a secret anymore!