0% found this document useful (0 votes)
21 views1 page

13 - PDFsam - 1. Language Fundamentals

The document discusses different primitive data types in Java: 1. Byte data type ranges from -128 to 127 and is best for handling streams of data from files or networks. 2. Short data type ranges from -32768 to 32767 and is best for 16-bit processors, which are now outdated. 3. Int is the most commonly used data type, with a size of 4 bytes and no size limitations.

Uploaded by

ROHIT JAIN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views1 page

13 - PDFsam - 1. Language Fundamentals

The document discusses different primitive data types in Java: 1. Byte data type ranges from -128 to 127 and is best for handling streams of data from files or networks. 2. Short data type ranges from -32768 to 32767 and is best for 16-bit processors, which are now outdated. 3. Int is the most commonly used data type, with a size of 4 bytes and no size limitations.

Uploaded by

ROHIT JAIN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

JAVA Means DURGA SIR

 The most significant bit acts as sign bit. "0" means "+ve" number and "1"
means "–ve" number.
 "+ve" numbers will be represented directly in the memory whereas "–ve"
numbers will be represented in 2's complement form.

Example:
byte b=10;
byte b2=130;//C.E:possible loss of precision
found : int
required : byte
byte b=10.5;//C.E:possible loss of precision
byte b=true;//C.E:incompatible types
byte b="ashok";//C.E:incompatible types
found : java.lang.String
required : byte
byte data type is best suitable if we are handling data in terms of streams either from
the file or from the network.

Short:

The most rarely used data type in java is short.


Size: 2 bytes
Range: -32768 to 32767(-215 to 215-1)
Example:
short s=130;
short s=32768;//C.E:possible loss of precision
short s=true;//C.E:incompatible types
Short data type is best suitable for 16 bit processors like 8086 but these processors are
completely outdated and hence the corresponding short data type is also out data type.

Int:

This is most commonly used data type in java.


Size: 4 bytes

nd
DURGASOFT, # 202,2 Floor,HUDA Maitrivanam,Ameerpet, Hyderabad - 500038,
13  040 – 64 51 27 86, 80 96 96 96 96, 9246212143 | www.durgasoft.com

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy