Question

Discussion: Primitive datatypes and built-in data structures Review the following website and discuss the representation and

please help!! i not understand this talking about but i am try to understand hard. i show you website https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html, thank you!

0 0
Add a comment Improve this question Transcribed image text
Answer #1

In programming language, we must aware of data types which tells about the type of data which is going to be stored or operated.

(i) byte:- when we have limited range of values from -128 to 127 then we can use byte data type to store integer values. Internally it uses 8 bit signed 2's complement integer. you know that negative number can be represented by 2's complement way.

for ex- byte value=-24; // internally it looks 11101000. (since 24 in binary= 00011000 now find 2's complement of it).

This data type is useful in using array. since large array may contain many cells. So if we will use int data type it would take 4*number of cells . Suppose int value[1000] then it would take 4000 byte of memory while if we use byte data type it would take 1 byte per cell so total memory =1000 byte only.

(ii) short:- This gives more range values. it has range of -32768 to 32767. It takes 2 bytes of memory. and internally it uses 16 bit signed 2's complement representation. It is used for integer representation.

(iii) int :- This gives more range of values. it consumes 4 byte of memory per cell in array.

(iv) long:- this is also for large range integer representation.

float and double are real point arithmetic values such as 23.455, 877.734873 etc. when we want to store decimal values also then we can use float and double.

boolean data type is used for storing true or false value. e.g boolean value=true;

lastly we have char data type which is used to store characters . e.g storing name . It uses 1 byte of memory .

DON'T FORGET TO HIT LIKE.

THANKS BY HEART.

  

Add a comment
Know the answer?
Add Answer to:
please help!! i not understand this talking about but i am try to understand hard. i...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I am having trouble solving these types of problems. Please help me understand by explaining and...

    I am having trouble solving these types of problems. Please help me understand by explaining and showing me the steps and methods needed to work this out. thank you.

  • Complete the Java command line application. The application accepts a URL from the command line. This...

    Complete the Java command line application. The application accepts a URL from the command line. This application should then make a HTTP request to “GET” the HTML page for that URL, then print the HTTP header as well as the HTML for the page to the console. You must use the Java “socket” class to do all network I/O with the webserver. Yes, I’m aware this is on Stack Overflow, but you must understand how this works, as you will...

  • I am trying to understand the following code I found in a website so that I...

    I am trying to understand the following code I found in a website so that I can use it for a project that evaluates boolean expressions. The code is below but I think it is in java because I do not understand it. Can you help me describe what it is doing in c++ so that I can understand it better? The link to the code is here: https://stackoverflow.com/questions/16762057/algorithm-to-evaluate-value-of-boolean-expression The code is below: public static boolean evaluateBool(String s) { Stack<Object>...

  • PLEASE HELP WITH THESE TWO, I AM HAVING HARD TIME WITH MATERIAL IM TRYING TO ESTABLISH...

    PLEASE HELP WITH THESE TWO, I AM HAVING HARD TIME WITH MATERIAL IM TRYING TO ESTABLISH A PATTERN OR CONSISTENCY .THANK YOU Implement Y-A+C B+D) using CMOS circuit Implement Y Y-A-B-C+A-B-C using CMOS circuit

  • I am writing a paper about “The Stanford Prison Experiment” please answer these questions to the...

    I am writing a paper about “The Stanford Prison Experiment” please answer these questions to the best of your abilites and provide any sort of website that you got some facts from so I can put it on my paper as well. thanks! What did you think of the study design. (Be careful not to refer to yourself in the 1st person. Try to either state information as if it is fact OR use phrases like "In this writers opinion")...

  • Hello, Would you please be able to answer this question number 1 please, I am having...

    Hello, Would you please be able to answer this question number 1 please, I am having a hard time understanding what is going on. Can you please write it out in detail how you get the answers you did, that way I can understand the thought process to answering a question like this. Thank you 1) (27 points) Give the structures of compounds A through I in the following series of reactions CH3 Brą, light CI Brą, AIBr; B AICI,...

  • Please help me I do not understand. Thank you! In your own words first, discuss three...

    Please help me I do not understand. Thank you! In your own words first, discuss three causes for the Cambrian explosion. Then address this question: Multicellularity evolved right before the Cambrian explosion; how do you think multicellularity enabled the Cambrian explosion (base your response on our discussion regarding the evolution of multicellularity).

  • This is a reminder that this is not a C++ or Java course. It is a...

    This is a reminder that this is not a C++ or Java course. It is a Data Structures course. This means that you are to write your own code unless otherwise specified in the assignment. The use of built in data structures types like linked lists, stacks, queues, trees, maps, graphs etc. is prohibited and will result in a 60% reduction in your grade. Furthermore, the lecture material presents code that should be used to get you started. Any data...

  • Please help with this question, I am having a hard time understanding. Need a clear diagram...

    Please help with this question, I am having a hard time understanding. Need a clear diagram to grasp the idea. Thank you! 3. Two wires lie perpendicular to the plane of the paper, and ass through the paper in th directions shown. Point P is equidistant from the two wires Construct a vector diagram showing the direction of the resultant magnetic field at point P due to currents in these two wires. Explain your reasoning. a) b) If the currents...

  • Please help with my homework I am struggling with, I have a idea to talk about...

    Please help with my homework I am struggling with, I have a idea to talk about a way how I could remember a grocery list, Is this a good way to start? Here are the intructions from the class, Thank you: Describe three mnemonic devices. Describe a situation requiring memorization of material and discuss how the three mnemonic devices could be used. Explain which mnemonic device you think would be most effective. Submit your answers in a Microsoft Word document.

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT