Java data types

  I would like to you, the type of data should not be regarded as strange, unless you that the programming language knowledge never contacted, but also do not know even what to do, because Below I will first tell us about the knowledge, Of course if you are very familiar with the data types, then you can skip this part below. 
  The concept of data type data types is the literal meaning of the data type. 
  Data is recorded information entities, such as 25000000, Pharaoh, and so on, but figures and other data and some of the most primitive symbols is not the same data in general should be meaningful, for instance, the number of 2500, we have only From the figures point of view, it is an integer math, but the data for 2500, it might mean a province's total grain output, may also refer to a company's profit, and so on. 
  Type is a very basic terms, it is used to a certain thing of the different attributes of components, such as some abstract said, I think you understand how the original now also understand how, it should be no mistake. 
  Therefore, the data types refers to the classification of data attributes.    We know that the data can take many forms, such as the types of digital data 35 (may mean a class size), 100 (may be a subject that a personal score), for example, the character data type A (possibly on behalf of a multiple-choice The first option), San (possibly on behalf of a personal name) and so on.    Obviously, these different types of data regardless of its form or its scope are best described in his own limitations, so to them in order to effectively use the distinction that people put forward the concept of data type. 
  I think you own the meaning of data types should be more clear now, although I am not an expert in this field, but I feel that my expression is not too obscure As it difficult. 
  Java data types (for the case of 32-bit CPU) 
  Java data types from the major area is divided into two parts: the basic data types and object data type. 
  Basic data types, it is more simple to express some basic information about the type of data, which includes the following categories: 
  Byte bytes in a computer-general of 8 bytes (in what is the meaning, I introduced below) 
  Char character of the two bytes, which is 16 
  2 short of the short two-byte integer, which is 16 
  Int shaping of the four bytes, which is 32 
  Long long integer of 8 bytes, which is 64 
  Single-precision real-float, after the decimal point seven effective retention figures, accounting for 32 
  Double-precision real-double, and after the decimal point to retain effective number 15, representing 64 
  Boolean Boolean, or a byte, 8-to tell us about the information bar.    We know that all the data in the computers are 0 and 1 to a combination of storage, such as a plastic figure in the computer in the form of actual storage: 
  00000000 00000000 00000000 00000001 
  Above a 0 or a 1 have been called a bit. 
  Below a table in the form of the table tell us about all the basic data types 
  Type bytes median range for example byte 8 1 negative 2 of 7 to 2 7-th-th integer -128,54127 short 16 2 negative 2 of the 15-th to the 15 th power of 2 integer 1348 , 6543 int 32 4 negative 2 of the 31-th to the 31 th power of two integers 0, -10000,345678 long 64 8 negative 2 of the 63-th to the 63 th power of 2 integer 987657897, -12 float 32 4 negative 2 of the 31-th to the 31 th power of 2 Real 23.987,87 F double 64 8 negative 2 of the 63-th to the 63 th power of 2 Real 2.0231,0.456 D char 16 2 negative 2 15 2, the 15-th to the integer 400, A, z, x, -23 boolean 8 1 true, false 

  Variables used in conjunction with the definition of the following examples: 
  Byte myByte = 49; 
  Byte myByte2 = 128; / / (error range too large) 
  Short myShort = 2345; 
  Int myInt = 123; 
  Int myInt2 = 012; / / (012 hexadecimal is using the figures 8 to 0 figures represent the beginning of the 8-band) 
  Int myInt3 = 0×12E5F; / / (0×12E5F using hexadecimal number of 16 to 0 x figures represent the beginning of the 8-band) 
  Long myLong = 23; 
  Long myLong2 = 245L; / / (L said that the value is at the end of a long integer) 
  Float myFloat = 456.56F; / / (F at the end said that the figure for the single-precision real-) 
  Double myDouble = 23.56789D; / / (D said that the figure for the end of double-precision real-) 
  If your 8-band and 16-band and 10 hex conversion is not clear, and I suggest that you do not have to rush in, I think in most cases the programming and less than fundamental.    However, I still think that a few examples of conversion is good. 
  We must first know that 8-band and 16 members of the basic band, we know that 10 band members to its basic 
  0 1 2 3 4 5 6 7 8 9 
  Remember the basic 8 band members and 16 members of the basic band: 
  8 basic band members: 0 1 2 3 4 5 6 7 
  16 hexadecimal basic: 0 1 2 3 4 5 6 7 8 9 ABCDEF (which ABCDEF representing 10 11 12 13 14 15) 
  8 to 10 hex hex: 
  8 hexadecimal number 345, for example, convert 10 hexadecimal number: 0 of 5 × 8 × 8-th +4 in a 2D +3 × 8 2D. 
  16 to 10 hex hex: 
  For example, the hexadecimal number 45, converted into 10 hexadecimal number: 0 of 5 × 16 × 16-th +4 th power of a good basic data types such bar on the first, we briefly talk about the subject of data types java . 
  Java Object Data Types 
  Java is an object-oriented programming language, java types of data included in the object data type.    For example String object, and an array of objects Date object, and so on.    Like the example below: 
  String username = "zhang san" / / String object 
  Date time = new Date () / / 8 date with the object of the basic data types Correspondingly, there are eight kinds of java in the corresponding object data types, namely: 
  Byte Short Integer Long Float Double Character Boolean 
  In addition, there are many other java object type, it will slowly mentioned, of course, is also a major peacetime practice more your own, slowly through the use of a common type, skilled your program design. 

2004-3-5

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Facebook
  • DotNetKicks
  • DZone
  • Netvouz
  • Propeller

Tags:

Releated Java Articles

Comments

Leave a Reply