Apex Data Types In Salesforce

Apex Data Types

   A data type is a classification of the type of data that a variable or object can hold in computer programming. Data types are an important factor in virtually all computer programming languages, including C#, C++, JavaScript, Visual Basic. and Apex. Apex programming language supports the following data types.

Primitive Data types:

        Primitive data types are the data types which are predefined by the apex. All the primitive data types are passed by value,not passed by reference. All apex variables whether they are class member variables are initialized to null make sure we initialize variables to appropriate values before using them. Following are the apex primitive data types.


A value that are assigned True , False  or Null.
Example: boolean isActive=true;


  A value that indicates a particular Day. Date values does't contain information about time. Date values always must be created by system static methods. The date format is like Year-Month-Day.
Example: Date myday=Date.newInstance(2015,03,26); 

  It's advanced to date. A value that indicates a particular day and time, such as a timestamp. The time format is like Hours-Minutes-Seconds-Milliseconds.
Example: DateTime myDaytime=newInstance(2015,03,26, 20,25,56,02); 


A number that include a decimal point.Decimal is an arbitrary Precision number. 
Example: Decimal dec=98.00;


  A 64-bit number that does't include a decimal point. Double have a minimum value of -263 and a maximum value of 263.
Example: Double d=5.1245d;


     A 32-bit number that does't include a decimal point. Integers have a minimum value of -2,147,483,648 and a maximum Value of 2,147,483,647.
Example: Integer i=0;


Any valid 18-character record identifier. 
Example: ID id='00300000003T2PGSR4';


A 64-bit number that does't include a decimal point. Long have a minimum value of -263 and a maximum value of 263.
Example:  Long l=1312123146L;


      If we declare a variable and does't initialize it with a value, it will be null. Null means absence of value.
Example: Integer i;
                Boolean b=Null;
Above both of the statements are nulls.


Strings are set of characters and are enclosed in a single quotes.They stores text values like name,address ect..
Example: String Name='Nagarjun';


S-objects ( Salesforce Objects) are standard or custom objects that stores data into data base. we can refer sobjects and their fields by their api names.
Example: Account, Contact, Student__c
                Account Acc= new Account();
                Student Std = new Student();



Apex Apex Default Methods Apex Methods Apex_Collections Apps Batch Apex Books CRM eBooks Data Import Wizard Data Management DataLoader Difference Between Error in Salesforce FAQ's FAQ's-Apex FAQ's-Apps FAQ's-CRM FAQ's-Data loader FAQ's-SOQL & SOSL FAQ'S-Triggers FAQ's-User Profile & Security FAQ's-VF Explorer Ide Formulas & Functions Integration Interview Questions Only Latest_Updates Limits&Best Practices Online-Training Reports and Dashboards Salesforce Deployment Salesforce Realtime Examples On Development Salesforce Realtime Task On Admin Salesforce Realtime Tasks Salesforce Realtime Tasks- Apex Salesforce Training Salesforce1 Mobile Sites SOQL Spring'14 Release Triggers User Profile & Security VF Tags VisualForce Winter'14 Release Wizard for Accounts/Contacts Workbench Workflows and Approvals
Sfdc Gurukul- All in one place for salesforce and step by step tutorial for beginners: Apex Data Types In Salesforce Apex Data Types In Salesforce Apex Data Types ,apex data types,apex data types salesforce,salesforce data types, data types, apex data types
Sfdc Gurukul- All in one place for salesforce and step by step tutorial for beginners
Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy