• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

BitSet,Properties,Observable class

 
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are the purpose of the BitSet,Properties,Observable class in the Util package?.
When the senario we've to use these classes?
 
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Observable can be used to implement the Observer pattern.
http://en.wikipedia.org/wiki/Observer_pattern

Properties can be used to read the Java properties file.

I never use BitSet, so I have no idea
 
Ranch Hand
Posts: 513
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A BitSet is typically used to store an application's option flags (each of which may only be true or false, e.g. "Enable the foo feature?" and "Always show the foo warning?"). While you can often do the same thing using bit operations on an int or long value, BitSet generally makes these operations more readable. Also, the int/long method gets far more troublesome when you need more than 64 flags, whereas BitSet can handle an arbitrary number of flags.


P.S.: None of these classes are on the SCJP exam, so don't get worried if you're just preparing for the exam and you happened to read this thread.
 
reply
    Bookmark Topic Watch Topic
  • New Topic