Core Java| JSP| Servlets| XML| EJB| JEE5| Web Services| J2ME| Glossary| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
The long keyword 
 

long is a keyword in java that is used to store 64-bit integer (Java primitive type) value.

 

The long keyword

                         

long is a keyword in java that is used to store 64-bit integer (Java primitive type) value. Keywords are basically reserved words which have specific meaning relevant to a compiler. The keyword long in java is also used to declare an expression, method return value, or variable of type long integer. The Long class in java programming language wraps a long type primitive value in an object. An Long type object includes only a single field whose type is long. Wrapper class is used to convert the long primitive values into Long type objects. In addition to this Long wrapper class also provides methods for converting a long to String and vice versa as well as other constants and methods that are useful to deal with long type.

Syntex:  Here is the syntax that displays how to declare and define a long type variable.

long number = 5;

Here are some more examples.

long anotherNumber = 34590L;

long octalNumber = 0377;

long hexNumber = 0xffl;

Note: Here are some points that must consider in case of long data type.

  • The Long class in java programming language is a wrapper class in order to support the long primitive type. Constants MIN_VALUE and MAX_VALUE are used to represent the range of values for this type.

  • In java programming language all integer literals are 32−bit int values unless the value is followed by l or L as in 235L, which specifies that the value should be interpreted as a long.

 

                         

» View all related tutorials
Related Tags: java c com stl process tags custom jstl unity tag community set war group js work to standard unit pos

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Training Courses
Tell A Friend
Your Friend Name
Software Solutions
Least Viewed
Most Rated
Recently Viewed
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.