Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Boolean vs boolean  RSS feed

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Thanks!
 
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Melinda
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
Dave

did I say boolean/boolean enough in that post?
 
To avoid criticism do nothing, say nothing, be nothing. -Elbert Hubbard. Please critique this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!