Perry Smith

Java Questions & Answers

Home / Java Q & A Page 2 / Java Q & A Archive Main Page

9-27-98

sizeof operator

why is sizeof operator not present in java

alonzo


Responses
9-28-98

Re: sizeof operator

uhhh.... what's the sizeof method do???

MikeD


9-28-98

Re: Re: sizeof operator

the operator sizeof is used in C & C++ to find the number of bytes for storage of a data type. I do believe get.length replaced this operator in jJAVA but I am not sure why.

lepue1@aol.com


9-29-98 Re: Re: Re: sizeof operator

in that case then, there is no standard throughout the API's to return the current size of a data collection. The ".size()" method seems to be common; it is valid for Vectors, some output streams, BitSets, and hashtables. Other API's use ".getLength()", such as arrays. Still others use ".length()" like Strings and Files.

MikeD


Home / Java Q & A Page 2 / Java Q & A Archive Main Page