Friday, June 22, 2012

Jython DATA TYPES


DATA TYPES

Numbers

·         Decimal integer: 1234, 1234567890546378940L        (or l)
·         Octal integer: 0177, 0177777777777777777L (starts with a 0)
·         Hex integer: 0xFF, 0XFFFFffffFFFFFFFFFFL (starts with a 0x or 0X)
·         Long integer (unlimited precision): 1234567890123456L (ends with L or l)
·         Float (double precision): 3.14e-10, .001, 10., 1E3
·         Complex numbers: 1J, 2+3J, 4+5j (ends with J or j. To create a complex number with a nonzero real part, add a floating point number to it with a '+')

Strings

The following sequences are defined as strings:
·         'Strings are enclosed in single quotes'
·         "Another string in quotes"
·         'String enclosed by single quotes with a " (double quote) in it'  
·         "String enclosed in double quotes with a ' in it"
·         '''A string that contains carriage returns and ' can be enclosed in tree single quotes'''  
·         """ Triple quotes can also be used"""  
·         r' non interpreted strings (the \ are kept). Useful for the windows paths!'  
·         R" non interpreted string"
Use \ at the end of the line to continue a string on several lines
2 adjacent strings are concatenated (ex : 'Oracle Data Integrator and' ' Python' is equivalent to 'Data Integrator and Python'.

No comments:

Post a Comment