lesson_04.1 - Data Types and Operations On Data Objective...

Info icon This preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Data Types and Operations On Data Objective To understand what data types are The need to study data types To differentiate between primitive types and reference types To know the data range and storage requirements for each type To know the conditions for data conversion To know the permissible operations that can be performed on data To be able to evaluate expressions
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Data Types and Operations On Data Introduction Data Types Primitive Type Integral Type Floating Point Type Character Type Boolean Type Type Compatibility Reference Type Arithmetic Operator and Operations Arithmetic Expressions Relational Operator and Operations Relational Expressions Logical Operator and Operations Input and Output Operations
Image of page 2
Data Types - Introduction The concept of data type is like what the bolts and nuts are to a piece of machinery . It is impossible to write meaningful program, without understanding: Data types, data values The amount of memory required for each type of data, and The permissible operations that can be performed on data
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Data Types - Introduction Like anything else, conservation of the use of memory is important. Some former languages did not consider conserving memory. Most of them had only two ways to store numeric values: int, for integers, and float, for floating point values. Hence wasting memory, especially when storing small values ; The amount of memory for each value, large or small, is the same.
Image of page 4
Introduction Data Types In the first section we: a) Study the fundamental data types in Java, and b) how they relate to programming. c) Focus on the operations that can be performed on each type. The second section introduces the reference type. This includes some of the fundamental Java classes, such as: a) The String class b) The Math class c) The wrapper classes
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
The Fundamental Types We had established that data is vital to a program. It must be stored in primary memory for the processor to handle it. The Java specifies two broad categories of data types: a) Primitive, and b) Reference type Primitive types are atomic They cannot be decomposed into simpler types Reference types are constructed from: a) Primitive types, b) As well as from other reference types
Image of page 6
Data Types Data types Primitive types Reference types Integral types Floating Point boolean Integers byte short int long float double User defined classes Java classes char Boolean types Character
Image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Primitive Types Primitive types are atomic There are three types integral, floating point, and boolean Integral they can be represented by an integer value There are two groups integer and character Integer byte, short, int, long
Image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern