• 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

The Package In Which Primitives Are Defined?

 
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which java package are primitives (boolean, byte, char, ..... , double, float) defined?
 
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The primitive types are part of the language, not the libraries so you won't find a definition for them in any packages like with java.lang.Integer, for example.
That's like asking, in what package is the "for" keyword defined?
But if you are really asking that, I guess I'd say look in the Java Language Specification
 
Natalie Kopple
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply. I should have explained my questions better. I am working on a configuration file. And I am stuck in giving a "type" to primitives.

firt name and last name are String(s). Is logon_date of java.util.Calendar type?
The cumulativeGPA is a double and the subscriber is a boolean, how do I specify their type in the configuration file?
[ July 03, 2003: Message edited by: Natalie Kopple ]
[ July 03, 2003: Message edited by: Natalie Kopple ]
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm guessing somewhere you use Class.forName(x).newInstance() or reflection to create object instances of the named classes. If so you'll have to specify object wrappers, ie the java.lang.Double class instead of the double primitive. Or write some special code that looks for the primitive types and takes a different approach.
Is that how you're using this info?
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving this fancy talk to the Intermediate forum...
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Stan is probably correct. It really depends on what is being done with these properties - there's an excellent chance that you can't user primitives, and will have to use the corresponding wrapper classes instead. However it's also possible (if the properties-processing code is sufficiently flexible) that actual primitives are allowed here. If so, the only appropriate syntax would be to just say type="double" rather than trying to prefix a package name onto the type. Primitives have no package, period. If the code doesn't accept that, you probably just can't use primitives here.
 
reply
    Bookmark Topic Watch Topic
  • New Topic