• 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

literals

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Integer literals that begin with a non-zero digit are in base 10 and are called decimal literals. Integer literals that begin with 0x are in base 16 and are called hexadecimal literals. Integer literals that begin with 0 followed by 0-7 are in base 8 and are called octal literals.

What does it mean in base 10,16,8 I am very new to java,can some one explain me about this.
Thanks in adv
Sri
 
Ranch Hand
Posts: 439
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
base 2 , base 8 , 10 and 16 are different systems which you can use for calculations. base 2 is what your computer uses switches that are 0 and 1's which make up bytes. base 8 is an octal system haven seen it used much in java but if you ever get a number that starts with a 0 first(int numbers) it means it's an octal . 16 system is still used your memory uses this type of system for look up and storage of infomration. You can do any sort of calculations with them. Anyway thsi system came from binary system. Someone just saw that it makes sence to split the byte into 16 bits. So in hex one byte is 16 bits. Decimal system is what you use every day. what you do in math ?
 
SRI PARUCHURI
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so, we have 32bit int 64 bit long they may be both negative or positive,is tht correct,I am not sure of I can remember the minimum and maximum values of all type of literals.is literals are so important in java.
Thanks for your reply.
Sri
 
That's a very big dog. I think I want to go home now and hug this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic