This isn't true is it?
-
In Java or .NET, yep. Are you still studying for your Java test? If so, definitely. -Jeff here, bloggy bloggy
-
-
In Java or .NET, yep. Are you still studying for your Java test? If so, definitely. -Jeff here, bloggy bloggy
-
I knew it, I read it somewhere before. This book i'm reading for my test says it's true! /\ |_ E X E GG
What book are you reading? Would you please quote what it says in the book for that? Thanks. Maxwell Chen
-
This book says it's true. That's a bunch of crap... Oh, well, I guess I have to go with it. Look at what they're teaching kids these days! /\ |_ E X E GG
It is true. No matter on what machine or OS .NET and/or Java are implemented, their platform specifications state unequivocally that each
int
will have four bytes. This has nothing to do with the operating system or anything else. -Jeff here, bloggy bloggy -
It is true. No matter on what machine or OS .NET and/or Java are implemented, their platform specifications state unequivocally that each
int
will have four bytes. This has nothing to do with the operating system or anything else. -Jeff here, bloggy bloggy -
It doesn't matter. It could be a 256-bit UberXeon from planet Xanax. Think of even Java and .NET primitive types as being abstractions of how the data's represented on the particular hardware, etc. -Jeff here, bloggy bloggy
-
I think that the Java Virtual Machine does the job to convert the order in different endians to Java desired endian. Maxwell Chen
-
What book are you reading? Would you please quote what it says in the book for that? Thanks. Maxwell Chen
Litvin, Maria. Be Prepared for the AP Computer Science Exam in Java. Andover, MA: 2003.
14. Which of the following statements about Java's platform independence are true?
I. The number of bytes used by an int variable is the same on any computer.
II. Java source code is complied into bytecodes, which may then be run on any computer with the Java Virtual Machine installed.
III. Overflow in arithmetic operations occurs at the same values regardless of the platform on which the Java program is running.
(A) I only
(B) II only
(C) I and II
(D) II and III
(E) I, II, and III/\ |_ E X E GG
-
It doesn't matter. It could be a 256-bit UberXeon from planet Xanax. Think of even Java and .NET primitive types as being abstractions of how the data's represented on the particular hardware, etc. -Jeff here, bloggy bloggy
-
You're not the first person to say that, but think of it this way: it would be hard to make a claim like "write once, run anywhere" if the code could behave differently on different platforms, right? -Jeff here, bloggy bloggy
-
The .NET Framework and Java are both PLATFORM INDEPENDANT. An Integer in either one is the same size on any CPU. Now, for assembly language, C/C++, or any other language that is tightly tied to the processor, that's a very different story... RageInTheMachine9532
-
The .NET Framework and Java are both PLATFORM INDEPENDANT. An Integer in either one is the same size on any CPU. Now, for assembly language, C/C++, or any other language that is tightly tied to the processor, that's a very different story... RageInTheMachine9532
-
Litvin, Maria. Be Prepared for the AP Computer Science Exam in Java. Andover, MA: 2003.
14. Which of the following statements about Java's platform independence are true?
I. The number of bytes used by an int variable is the same on any computer.
II. Java source code is complied into bytecodes, which may then be run on any computer with the Java Virtual Machine installed.
III. Overflow in arithmetic operations occurs at the same values regardless of the platform on which the Java program is running.
(A) I only
(B) II only
(C) I and II
(D) II and III
(E) I, II, and III/\ |_ E X E GG
:eek: Primitive Types[^] The values represented by these types are specified in Table 3-1. The representation shown is used on all platforms and is independent of the native platform architecture. int 32-bit, signed, two's complement All of the signed integer types in Java use a two's complement representation. Two's complement is a binary encoding for integers, which has the following properties: The leftmost bit is the sign bit. If the sign bit is 1, the number is negative. Positive numbers have the usual binary representation. Negating a number involves complementing all of the bits in the number and then adding 1 to the result. The most negative value does not have a positive equivalent. ........ Maxwell Chen
-
This book says it's true. That's a bunch of crap... Oh, well, I guess I have to go with it. Look at what they're teaching kids these days! /\ |_ E X E GG
As far as Java is concerned, it is true. The VM for each OS has the job of deciding how big to make the int, but as far as Java programming is concerned, an int is an int. Think about it - you don't need to use a bunch of pre-processors in java to determine how to typedef ints.
Glano perictu com sahni delorin!
-
In C/C++, the size of an
int
is compiler-dependent. It's 16 bits in Win16, 32 bits in Win32/Win64, and so on. I believe the C++ spec says it has to be at least 16 bits. In other languages they define the size of anint
explicitly. --Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ ---- "Just because the box has 2 gigabytes of memory doesn't mean you get to use it all!" -- Rico Mariani, CLR perf guy -
You're not the first person to say that, but think of it this way: it would be hard to make a claim like "write once, run anywhere" if the code could behave differently on different platforms, right? -Jeff here, bloggy bloggy
Well, they should have dropped the int for clarity and used DWORD. ----------------------- New and improved: kwakkelflap.com My second CP article: MAP files[^] "Hey, Eddie, can I pour you a beer?" "A little early, isn't it, Richy?" "For a beer?" "No, for stupid questions."
-
I see you later qualify it for ints in Java. In that case all use 4 bytes. Elaine :rose: The tigress is here :-D