Data Types Imran Rashid CTO at ManiWeber Technologies.

Slides:



Advertisements
Similar presentations
STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
Advertisements

Ch. 3 Variables VB.Net Programming. Data Types Boolean – True or False values Short – Small integers (+/- 32,767) Integer – Medium-size integers (+/-
C# Language Report By Trevor Adams. Language History Developed by Microsoft Developed by Microsoft Principal Software Architect Principal Software Architect.
Neal Stublen C# Data Types Built-in Types  Integer Types byte, sbyte, short, ushort, int, uint, long, ulong  Floating Point Types.
Objective: Dealing with data in C++ Agenda: Notes Essay Help.
Constants and Data Types Constants Data Types Reading for this class: L&L,
Data Types and Expressions
©2004 Brooks/Cole Chapter 2 Variables, Values and Operations.
CIS 234: Using Data in Java Thanks to Dr. Ralph D. Westfall.
Primitive Types Java supports two kinds of types of values – objects, and – values of primitive data types variables store – either references to objects.
1 Chapter Two Using Data. 2 Objectives Learn about variable types and how to declare variables Learn how to display variable values Learn about the integral.
Programming Principles Data types and Variables. Data types Variables are nothing but reserved memory locations to store values. This means that when.
.NET Data types. Introduction ٭ A "data type" is a class that is primarily used just to hold data. ٭ This is different from most other classes since they're.
CSCI 1100/1202 January 16, Why do we need variables? To store intermediate results in a long computation. To store a value that is used more than.
3. Declaring Value-Type Variables
Copyright © 2002 W. A. Tucker1 Chapter 7 Lecture Notes Bill Tucker Austin Community College COSC 1315.
Chapter 2: Using Data.
Lec 6 Data types. Variable: Its data object that is defined and named by the programmer explicitly in a program. Data Types: It’s a class of Dos together.
Data & Data Types & Simple Math Operation 1 Data and Data Type Standard I/O Simple Math operation.
Java Simple Types CSIS 3701: Advanced Object Oriented Programming.
Primitive Variables.
Objects, Classes and Syntax Dr. Andrew Wallace PhD BEng(hons) EurIng
C# C1 CSC 298 Elements of C# code (part 1). C# C2 Style for identifiers  Identifier: class, method, property (defined shortly) or variable names  class,
Java Programming, Second Edition Chapter Two Using Data Within a Program.
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
1.2 Primitive Data Types and Variables
Chapter One Lesson Three DATA TYPES ©
A: A: double “4” A: “34” 4.
ITK 168 – More Variables 10/13/05. Another example of using instance variables and constants  Go through SimpleBot  Modify SimpleBot to “teleport”
 Variables can store data of different types, and different data types can do different things.  PHP supports the following data types:  String  Integer.
Primitive Data Types 1 In PowerPoint, point at the speaker icon, then click the "Play" button.
 Variables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in memory. 
A data type in a programming language is a set of data with values having predefined characteristics.data The language usually specifies:  the range.
Computer Programs CS 1400 Dennis A. Fairclough Version 1.1 CS 1400 Dennis A. Fairclough Version 1.1.
 Data Type is a basic classification which identifies different types of data.  Data Types helps in: › Determining the possible values of a variable.
Primitive Data Types. int This is the type you are familiar with and have been using Stores an integer value (whole number) between -2,147,483,648 (-2.
Basic Data Types อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา Chapter 4.
Introduction C# program is collection of classes Classes are collection of methods and some statements That statements contains tokens C# includes five.
Chapter 2 Variables and Constants. Objectives Explain the different integer variable types used in C++. Declare, name, and initialize variables. Use character.
1 ENERGY 211 / CME 211 Lecture 3 September 26, 2008.
Topics introduced today (these topics would be covered in more detail in later classes) – Primitive Data types Variables Methods “for” loop “if-else” statement.
Fundamentals 2.
Basic Introduction to C#
CIS3931 – Intro to JAVA Lecture Note Set 2 17-May-05.
Variable Declarations
Data Types The type states how much and what kind of data the variable can store. integers- whole numbers no fractional parts int, short, long floating.
Selenium WebDriver Web Test Tool Training
Understand Computer Storage and Data Types
Java package classes Java package classes.
Chapter 2.
.NET and .NET Core 5.2 Type Operations Pan Wuming 2016.
Dr Shahriar Bijani Winter 2017
IDENTIFIERS CSC 111.
Review Operation Bingo
Unit-2 Objects and Classes
.Net Programming with C#
Computers & Programming Languages
Variables, Loops, Decision Statements, etc
C++ Data Types Data Type
Chapter 2: Java Fundamentals
Storing Information Each memory cell stores a set number of bits (usually 8 bits, or one byte) (byte addressable)
Variables Data Types Lab 0B
Chapter 2: Java Fundamentals
ECE 103 Engineering Programming Chapter 8 Data Types and Constants
B065: PROGRAMMING Variables 1.
Variables and Computer Memory
Java’s Central Casting
Chapter 3 Introduction to Classes, Objects Methods and Strings
Arrays Imran Rashid CTO at ManiWeber Technologies.
Variables and Constants
Presentation transcript:

Data Types Imran Rashid CTO at ManiWeber Technologies

Outline What are Types? Classes & Structures

What are Types?

What are Types? In C# when we store data, we have to say what type of data we are storing A type defines what information a variable contains Variables in C# are strongly typed A typed implies minimum, maximum values Once declared, a variable’s type can’t be changed C# Built-in Data Types Logical Numeric Characters & Strings Classes & Structures Objects

Classes & Structures

object o1 = new Object(); object o2 = o1; // o2 references o1 Classes & Structures Types are represented in .NET as classes or structures Both have members: fields & methods You can create instances of either a class or structure Classes vs. Structures Structures are value types Classes are reference types int v1 = 5; int v2 = v1; // v2 is copy of v1 object o1 = new Object(); object o2 = o1; // o2 references o1

Classes & Structures Common Structures Numeric and logical built-in types are structures Examples bool a true/false value int a 32-bit integer double a 32-bit floating point value decimal a 128-bit high-precision value

System.Boolean System.Char Classes & Structures Logical & Character Types All .NET types are members of System You should only use type alias (fully qualified names) C# Type .NET Type Min Max bool Boolean false true char Char U+0000 U+ffff System.Boolean System.Char

Classes & Structures Integer Types C# Type .NET Type Min Max byte Byte 255 sbyte SByte -128 127 short Int16 -32,768 32,767 ushort UInt16 int Int32 -2, 147, 483, 648 2, 147, 483, 647 unint UInt32 4, 294, 967, 295 long Long -9.22 x 1018 9.22 x 1018 ulong Ulong 1.84 x 1019

Classes & Structures Floating-Point and Decimal Types Decimal is a 128-bit, high-precision type Appropriate for currency and other financial values C# Type .NET Type Min Max Precision float Single ±1.5e-45 ±3.4e38 7 digits double Double ±5.0e-324 ±1.7e308 15-16 digits decimal Decimal -7.9 x 1028 7.9 x 1028 28-29 digits

C# Type .NET Type Max string String 2, 147, 483, 647* Classes & Structures Strings Decimal is a 128-bit, high-precision type *Theoretical! Memory is more important! Mobile app where memory is small System.String is a class, not a structure C# has give a lot of tools to help with string immutability C# Type .NET Type Max string String 2, 147, 483, 647*

Any ?