September 09, 2010, 01:55:00 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  Home Help Media Affiliates Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Literal values  (Read 967 times)
0 Members and 1 Guest are viewing this topic.
Croco
Staff
Member
*

Reputation: 1
Offline Offline
Gender: Male
Posts: 64
Referrals: 0

Awards
« on: June 11, 2007, 06:49:28 PM »

Code
GeSHi (java):
  1.  
  2. // file name Literals.java
  3.  
  4. public class Literals {
  5.  
  6.  
  7. char c = 0xffff; // max char hex value
  8. byte b = 0x7f; // max byte hex value
  9. short s = 0x7fff; // max short hex value
  10. int i1 = 0x2f; // Hexadecimal (lowercase)
  11. int i2 = 0X2F; // Hexadecimal (uppercase)
  12. int i3 = 0177; // Octal (leading zero)
  13. // Hex and Oct also work with long.
  14. long n1 = 200L; // long suffix
  15. long n2 = 200l; // long suffix (but can be confusing)
  16. long n3 = 200;
  17. //! long l6(200); // not allowed
  18. float f1 = 1;
  19. float f2 = 1F; // float suffix
  20. float f3 = 1f; // float suffix
  21. float f4 = 1e-45f; // 10 to the power
  22. float f5 = 1e+9f; // float suffix
  23. double d1 = 1d; // double suffix
  24. double d2 = 1D; // double suffix
  25. double d3 = 47e47d; // 10 to the power
  26. }
  27.  
  28.  
Created by GeSHI 1.0.7.20

there is no output here ....
Logged
Javaforums.net :: a community about Java software development.
« on: June 11, 2007, 06:49:28 PM »

 Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC
TinyPortal v0.9.8 © Bloc
Valid XHTML 1.0! Valid CSS!
Page created in 0.3 seconds with 32 queries.

Google visited last this page September 07, 2010, 01:46:14 PM