• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Widening Conversions of primitives

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've noticed that starting with "int", the wideners, in order add one byte to the name of the primitive, like this:
int(3)->long(4)->float(5)->double(6)
Kinda stupid memorization tool, I know, but there it is.
Then you just have to remember the 2 paths to int:
char->int & byte->short->int
and you've got it.
 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Khamon,
Thanks for the layout...
Regards,
Nijeesh.
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I am very much confused with this statement can u clarify me vividly please this statement
int(3)->long(4)->float(5)->double(6)
what is the meaning of this clarify me please
 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Narayana,
int(3 char long...)
long(4 char long...)
float(5 char long...)
double(6 char long...)
That is what is meant by
int(3)->long(4)->float(5)->double(6)
HTH
Shubhangi.
 
reply
    Bookmark Topic Watch Topic
  • New Topic