The Artima Developer Community
Sponsored Link

Java Answers Forum
variables

1 reply on 1 page. Most recent reply: Dec 30, 2002 1:57 PM by Matt Gerrans

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
A E

Posts: 2
Nickname: ewhop
Registered: Dec, 2002

variables Posted: Dec 28, 2002 3:40 PM
Reply to this message Reply
Advertisement
how many bytes a string can hold?

a boolean variable can hold only 1 byte?

what is the range of values a variable declared as char can take?


Matt Gerrans

Posts: 1153
Nickname: matt
Registered: Feb, 2002

Re: variables Posted: Dec 30, 2002 1:57 PM
Reply to this message Reply
> how many bytes a string can hold?

Strings don't hold bytes, they hold characters.

I think the limit probably larger than the amount of memory you have, but may also be arbitrarily limited by a particular JVM implementation. The impirical limit based on what we can see of the interface would be 2^64 bytes (2^63 because length() returns an int and multiply by another two because a character is two bytes).

> a boolean variable can hold only 1 byte?

No, it can only hold 1/8 of a byte. How many bits (or bytes) the JVM uses to store one boolean is different question.

> what is the range of values a variable declared as char
> can take?

From Character.MIN_VALUE to Character.MAX_VALUE.

Flat View: This topic has 1 reply on 1 page
Topic: java input method framework Previous Topic   Next Topic Topic: The startup class of Weblogic

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use