Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Class 5


Published on

  • Be the first to comment

  • Be the first to like this

Class 5

  1. 1. Kenia Álava
  2. 2. There are a bunch of guys that are used very often in programming and requires specialtreatment. Types can be considered as "primitive", the reason for this special treatment isthat to create a new object, a simple variable small, not efficient. To these primitive types,Java uses the technique used in C and C + +, that is, instead of creating the new variablecreates a variable "automatic" is not a reference.Java determines the size of each primitive type. These sizes do not change from onemachine to another architecture. This invariability of the sizes is one of the reasons ofportability java. Kenia Álava
  3. 3. Defaults primitive membersWhen a primitive data type as a member of a class, Java guarantees that you will beassigned a default value if it fails to boot:The defaults are only the values that Java guarantees when the variable is used as a classmember. This ensures that the member variables of primitive type always be initialized(something C + + does not do), reducing a source of potential errors. However, this initialvalue may not be correct or even legal for the program you are writing. It is best to alwaysinitialize variables explicitly.This warranty does not apply to initialize local variables, those that are not class fields. Kenia Álava