Objective-C for Java programmer Part 1
Object and basic type
Java contains the original, or a small part.InternalType. Are these values the objects one of the largest semantic differences between Java and smalltalk. In smalltalk, the original type is treated as an object and is transparent boxed through the compiler or virtual machine. In Java and objective-C, they are clear.
Java only has a small part of the original type. It has four types of signed integers, two types of floating point values, Boolean and character. All types of objective-C support the original type. Core Groups are similar, but there are some important differences. First, C defines only the minimum range of one type. In short Java, it is always 16 bits. The short value is usually 16 bits in C. JavaOneInt, always 32 bits.OneInt,
On a platform where C is 16,32 or 64bit, it may exist today, but it may be 128 bits in the future, but it is usually a 32-bit platform where you can use objective-C.
Inheritance in objective-CTypedefThere are many definitions from the C keyword and a standard. Stdint. h header, for example, defineUint32_tAndInt32_tType, always unsigned or signed on each platform, you can use a 32-bit integer.
OneTypedef"The objective-C standard provides type D which isBOOL, This should onlyYESOrNO. This is reallyOneChar (an octal group on most platforms), and there are various methods, it may get a value that is neitherYESOrNO.
The shares in Java and Objective-C are the same initialization rules of the original type. If they declare an object in an instance variable (what is a field called by Java), they will be initialized to the object that is instantiated when 0. If they are local variables, they will be initialized to an undefined value.
Technically, Objective-C does not define how to instantiate objects. Unlike Java, Objective-C does not define all the memory models. It inherits from the C object, by convention, allocated things, packaged CCalloc () functionLibrary function. On OS X, this package is quite complex, but the final result is that each object you create sets the uninitialized value to 0.
An important difference is that Objective-C inherits all the non-structural object types in C. Java, and everything is an object or a primitive. In Objective-C, you also have structures, original arrays, and unions.
Some structures used by Cocoa in some places, includingNSPoint, Which represents the point in a two-dimensional space. Different objects are always passed by reference, and the structure is usually passed by value. They are easier to create than real objects.