Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1025091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:52:35+00:00 2026-05-16T11:52:35+00:00

What type of variable that can contain 1,000,000,000(a decimal number) takes the most memory

  • 0

What type of variable that can contain 1,000,000,000(a decimal number) takes the most memory space?

  1. int in C
  2. string in C
  3. string in Java(which uses unicode)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T11:52:36+00:00Added an answer on May 16, 2026 at 11:52 am

    A Java String. Under the hood A Java String consists of an object with 3 fields, one of which points to a separate array object containing the characters. Plus of course, Java Strings are composed of 16 bit characters1.

    If you are worried about memory usage over all other criteria, don’t use Java. But for most applications, memory usage is the least of your concerns.

    It is worth noting that 1,000,000,000 can be represented using a Java int which will be the same size as a C signed or unsigned (32 bit) integer.

    Furthermore, a C int is not necessarily big enough to represent 1,000,000,000. On some platforms, int is 16 bits, and this is allowed by the C standard.


    1 – Actually, this is Java platform dependent. For example, in Java 9 they modified the String implementation to use one byte per character for strings that are composed entirely of characters in the range 0 to 255. See this article. But despite this, a Java string still takes more space than a C string.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got in a session a class with type-safe variable; int, string, dataset, etc
Suppose I have a variable of type Int = 08, how can I convert
is it possible to specify that a NSMutableArray can only contain a certain type
I have a reference-type variable that is readonly , because the reference never change,
Is there a native c++ variable type that's bigger than a double? float is
Given a variable foo of type FooClass* and a member variable in that class
I need to convert from a SQLVARCHAR to a string data type Variable definitions
I need your help, For example I have a decimal type variable and I
I have a variable of type Number, and i like to obtain the sign
If I have variable of type IEnumerable<List<string>> is there a LINQ statement or lambda

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.