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 arrays in java  RSS feed

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I am coding a program that is using a boolean array to select different values in a interval. All the values are originally set on true, then some values are assigned to false. Is there a way to select all the true values of that array ? I can't find one in the array API in java.
Thanks for your time.
 
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Sebastien Zerbato wrote:Hello, I am coding a program that is using a boolean array to select different values in a interval. All the values are originally set on true, then some values are assigned to false. Is there a way to select all the true values of that array ? I can't find one in the array API in java.


That usually means that there isn't one. You may have more success with java.util.BitSet.

Winston
 
Sebastien Zerbato
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I will try that, thank you.
 
Liar, liar, pants on fire! refreshing plug:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!