Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How do different data types depend on operating system in java?

I’m working with audio files in java (Assignment in my laboratory), and i read bytes from file then i convert them to primitive data types int and short. As i know primitive data types depend on compile settings and operating system. So how they depend on ? Are there immutable data types in java ? (i mean data types those don’t depend on operating system and compile settings)

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Java primitives data types are not OS dependent.

These are the values for those types, and they are always the same.

Type Bytes Range
byte 1 -128 to 127
short 2 -32,768 to 32,767
int 4 -2,147,483,648 to 2,147,483,647

You can find out more about them here

How data is stored in files might be a different topic.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading