my dog learned polymorphism*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Data Types Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Data Types" Watch "Data Types" New topic
Author

Data Types

rashid khokhar
Greenhorn

Joined: Mar 12, 2001
Posts: 4
We know that when we use small numbers then we use small data types like short or byte and for larg number we use long or others but i read in a book "type(byte,short,int,.....) determines behavior not size" pls explain.
------------------
Bob Lancaster
Greenhorn

Joined: Feb 21, 2001
Posts: 4
Originally posted by rashid khokhar:
We know that when we use small numbers then we use small data types like short or byte and for larg number we use long or others but i read in a book "type(byte,short,int,.....) determines behavior not size" pls explain.

The type determines the number of bytes allocated in the memory, and the range of possible values. The number 17 could be a byte, short, int or long. The value 75000 could only be an int or long.
A better explaination could be found in Chapter 1 of RHE.
I have noticed that the answers to most, if not all, of your questions could be found in The Complete Java 2 Certification Study Guide by Roberts, Heller and Ernest. If you do not have this book, buy it. If you are studying for the SCJP and/or the SCJD exam, the book is worth its weight in gold.
-Bob Lancaster
SCJP working on SCJD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Data Types
 
Similar Threads
Use of 4 Types of Integar Data Type
byte addition
Primitive Types!!!
size-of primitive in java
Serious Conversion Problem - Please HELP