Oracle OCA J2SE7 Cetificate - Rules for Primitive Types

  • Any bigger than an int can NEVER be assigned to an int or anything smaller than int (byte, char, or short) without explicit cast.
  • Constant values up to int can be assigned (without cast) to variables of lesser size (e.g. short to byte) if the values are representable by the variable.
  • Operands of mathematical operators are ALWAYS promoted to AT LEAST int. (e.g. byte*byte both bytes will be first promoted to int) and the return value will be AT LEAST int.
  • Compound assignment operators (+=, *= etc) have strange ways so ready this carefully: A compound assignment expression of the form E1 op = E2 is equivalent to E1 = (T)((E1) op (E2)), where T is the type of E1
  • A char value can ALWAYS be assigned to an int variable, since the int type is wider than the char type.
  • A narrowing primitive conversion may be used if all of the following conditions are satisfied:
    1. The expression is a constant expression of type int.
    2. The type of the variable is byte, short or char.
    3. The value of expression is representable in the type of the variable.
    4. NOTE THAT narrowing conversion doesn‘t apply to long or double. So, char ch = 30L; will fail althrough 30 is representable by a char.
时间: 2024-08-14 20:58:57

Oracle OCA J2SE7 Cetificate - Rules for Primitive Types的相关文章

Java中的原始类型(Primitive Types)与引用类型(Reference Values)

Java虚拟机可以处理的类型有两种,一种是原始类型(Primitive Types),一种是引用类型(Reference Types). 与之对应,也存在有原始值(Primitive Values)和引用值(Reference Values)两种类型的数值可用于变量赋值.参数传递.方法返回和运算操作. 原始类型与值 Java虚拟机支持的原始数据类型包括数值类型.布尔类型和returnAddress类型. 数值类型包括:整数类型和浮点类型. 整数类型包括: 1.byte 2.short 3.int

Prefer Domain- Specific Types to Primitive Types

Prefer Domain- Specific Types to Primitive Types Einar Landre ON SEPTEMBER 23, 1999, the $327.6 million Mars Climate Orbiter was lost while entering orbit around Mars due to a software error back on Earth. The error was later called the metric mix-up

Primitive Types and Expressions

Class Data or Attributes state of the application Methods or Functions have behavior Namespace is a container for related classes Assembly (DLL or EXE) is a container for related namespaces is a file which can either be a EXE or  a DLL Application in

Primitive Types in Go

Introduction As a strong  type static language, Go has many primitive types we will care about. In first level, they can be divided into two groups: non-collection and collections(e.g. array, slice, map). In this article we will talk three different

使 Excel 规则更容易理解(Oracle Policy Modeling-Make your Excel rules easier to understand)

有以下几种方法可以使 Excel 规则更容易理解. 在 Excel 工作簿中缩短属性名称 您可以使用图例关键字创建在 Excel 中引用属性的缩写方式.可以根据情况指定此缩写形式. 要指定图例关键字,请执行以下操作: a.在 Excel 中,打开声明工作表. b.在属性类型和属性文本列旁边,添加标题“图例关键字”.单击 Oracle Policy Modeling 工具 栏上的图例关键字标题按钮以设置此单元格的样式.注:此列已存在于默认的 Excel 工作表中, 因此,仅当您在某个阶段人工删除了

Optimizing Item Import Performance in Oracle Product Hub/Inventory

APPLIES TO: Oracle Product Hub - Version 12.1.1 to 12.1.1 [Release 12.1] Oracle Inventory Management - Version 12.1.1 to 12.1.1 [Release 12.1] Oracle Item Master - Version 12.0.6 to 12.0.6 [Release 12] Information in this document applies to any plat

Scheduling Jobs with Oracle Scheduler

In this chapter: About Scheduler Objects and Their Naming Creating, Running, and Managing Jobs Creating and Managing Programs to Define Jobs Creating and Managing Schedules to Define Jobs Using Events to Start Jobs Creating and Managing Job Chains Pr

Oracle常见错误及解决方法

环境:LINUX下的oracle数据库10g ORA-12541:TNS:没有监听器 原因:没有启动监听器或者监听器损坏.如果是前者,使用数据库安装的用户oracle(这里oracle用户是指Linux用户,非oracle或者root的其他用户可能没有权限操作安装目录下的文件)进入Linux系统,然后: [[email protected] ~]$ lsnrctl status #查看监听器的状态[[email protected] ~]$ lsnrctl status #如果没有启动那就使用此

Converting to Oracle Real Application Clusters from Single-Instance Oracle Databases

Converting to Oracle Real Application Clusters from Single-Instance Oracle Databases This chapter describes the procedures for converting from Oracle Database 11g release 2 (11.2) single-instance databases to Oracle Real Application Clusters (Oracle