Apex 的集合主要包括 List/Map/Set,其中 List 是一个具有索引的对象集合,如果存储的是基础类型数据还支持排序的功能例如 Integer、String 等,如果数据想存储在一个可以具有索引的集合则可以使用 List,同时 Apex 的 SOQL 查询(参考 SOQL 和 SOSL 查询 )语句返回的结果也是 List 集合。List 集合 的索引从零开...
1、原始数据类型(Primitive) 整数:Integer 双精度:Double 单精度:Decimal 长整型:Long 日期:Date 日期时间:Datetime 字符串:String ID:ID 布尔值:Boolean 2、整数类型 Integer 任何32位数,不包括任何小数点的数。 值的范围是-2,147,483,648,最大值为2,147,483,647。 【示例】声明一个变量,保存参加运动会跳远...
基本类型(Primitive)(Integer, Double, Long, Date, Datetime, String, ID, or Boolean) Collections(Lists, Sets and Maps)(将在第6章中介绍) sObject Enums Classes, Objects and Interfaces(将在第11,12和13章中介绍) 在本章中,我们将查看所有原始数据类型,sObject和枚举。 我们将在接下来的章节中查看集...
一)基本变量:1)IntegerInteger表示一个32位整数的对象,取值范围为-231 - 231.Integer主要有两个方法:1234567891011/* public String format() /译:将Integer值转换成String类型的值 */Integer goodsCount = 12;System.debug( 4、'将Integer值转成String: ' + goodsCount.format();/* public static Integer ...
s.compareTo('A'); 就会产生错误 类型转化 Apex中的隐式类型转换:对于数字类型,精度由低到高依次是Integer,Long,Double,Decimal,低精度的类型可以自动转换为高精度类型, 另外ID类型的值常自动转换成String类型,String类型的值也可以隐式转换成ID类型,但是在运行期间,会将该值进行检查,如果不是合法的ID类型,则抛出...
Apex有四种转换器:String类型转换器、Integer类型转换器、Boolean类型转换器和Date类型转换器。String类型转换器可以将字符串转换为其他类型,如日期类型、数字类型、布尔类型等;Integer类型转换器可以将整数转换为其他类型,如字符串类型、日期类型、布尔类型等;Boolean类型转换器可以将布尔值转换为其他类型,如字符串类型、数...
Primitive (Integer, Double, Long, Date, Datetime, String, ID, or Boolean) 原始(整数,双精度,长整型,日期,日期时间,字符串,ID或布尔值) Collections (Lists, Sets and Maps) (To be covered in Chapter 6) 集合(列表,集合和地图)(将在第6章中讨论) ...
This automatically-maintained list of primary key values is useful to use as a bind variable in a query. For example, theSelected Grid Primary Keys in Wordsclassic report region below the grid has the followingselectstatement referencing:P4_SELECTED_EMPNOSNotice how it uses theapex_string.split(...
Map<String,String> map = new Map<String,String>(){'a' => 'b','c' => 'd'}; 变量 Apex中的变量被声明后如果不初始化,其初始值都是null Apex变量不区分大小写 Integer I; Integer i;//报错 另外,对sObject对象和字段的引用也不区分大小写,如 ...
parameters stringtointeger type: string return value type: integer example integer myint = integer . valueof ( '123' ) ; valueof(fieldvalue) converts the specified object to an integer. use this method to convert a history tracking field value or an object that represents an integer va...