This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
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
posted
0
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