[Java programming ideology] 3. Operators and java programming ideology Operators

Source: Internet
Author: User
Tags bitwise operators

[Java programming ideology] 3. Operators and java programming ideology Operators
Thinking in Java

At the bottom layer, data in Java is operated by using operators. I have mastered C and C ++ before, so this chapter does not have much to look. It mainly aims to understand the differences between Java and C ++. For example:
    • String type: Supports "+" and "+ =" operations
    • "+" Operator: "+" In the System. out. println (); statement means "String connection" and tries to convert the following non-String type to the String type. For example, print ("" + I) converts I to the string type;
    • Alias symptom: After a = B is executed, a = c is executed. This does not affect B. However, when an object is assigned to another object, "Reference" is actually copied from one place to another. This means that both references point to the same object. To avoid this phenomenon, assign t1.value = t2.value; to overwrite the object.
    • Test object equivalence: Pay attention to the use of "=" and equals ()
    • Logical operators: "&", "|", "!" The operation can only apply and boolean values (this is different from C ++)
    • "Short-circuit effect ":For example, if (t1 & t2), the program first judges the Boolean value of t1. if t1 is false, t2 is not executed directly.
    • Direct constant: The integer is of the ing type by default, and the floating point is of the double type by default. You can add a suffix to change its type.
    • Bitwise Operator: "&", "|", "~" And "^" are similar to the C language and remain unchanged.
    • Shift Operator: "<" Left shift (low complement 0); ">" right shift (positive complement 0, negative complement 1); ">>>" unsigned right shift (whether positive or negative, if the char, byte, and short values are shifted, they are converted to the int type before the shift; the result is also of the int type;
    • Type conversion Operator: In Java, you do not need to display type conversions for "extended conversions", but the operations when performing narrow conversions are at risk of information loss. At this time, the compiler will force us to perform type conversion, otherwise the compilation will not pass;
      • Tail truncation and rounding
      • Type Improvement
      • Java does not have sizeof

 


I recently read java programming ideas. Chapter 3 operators do not understand the shift code.

00000000 00111111 11111111 11111111 and 22 1 values are the same, but the Integer. toBinaryString function does not output the previous 0

Where is the fourth edition of java programming ideology published by the publisher?

This website has bought www.china-pub.com/34838 comments from readers.
Preface
Introduction
Chapter 2 object Introduction
1.1 abstract process
1.2 each object has an Interface
1.3 each object provides services.
1.4 specific implementation of hiding
1.5 reuse implementation
1.6 inheritance
1.6.1 The relationship between "is-a" and "is-like-"
1.7 interchangeable objects accompanied by Polymorphism
1.8 single inheritance Structure
1.9 containers
1.9.1 parameterized type (fan type)
1.10 creation and lifecycle of Objects
1.11 Exception Handling: handling errors
1.12 concurrent programming
1.13 java and internet
1.13.1 what is web
. 1.13.2 client Programming
1.13.3 Server programming
1.22 conclusion
Chapter 1 everything is an object
2.1 manipulate objects with reference
2.2 you must create all objects
2.2.1 storage location
2.2.2 Special Case: Basic Type
2.2.3 arrays in java
2.3 never need to destroy objects
2.3.1 Scope
2.3.2 scope of an object
2.4 create a new data type: Class
2.4.1 fields and Methods
2.4.2 default value of basic members
2.5 Methods, parameters, and returned values
2.5.1 parameter list
2.6 construct a java program
2.6.1 name visibility
2.6.2 use other components
2.6.3 static keyword
2.7 your first java program
Compile and run
2.8 comments and embedded documents
2.8.1 comments
2.8.2 syntax
2.8.3 embedded html
2.8.4 some tag examples
2.8.5 document examples
2.9 encoding Style
2.10 conclusion
2.11 exercise
Chapter 1 Operators
3.1 simpler print statements
3.2 use java Operators
3.3 Priority
3.4 assignment
3.4.1 alias problems in method calls
3.5 Arithmetic Operators
3.5.1 unary addition and subtraction Operators
3.6 auto increment and decrease
3.7 Relational operators
3.7.1 test object equivalence
3.8 logical operators
3.8.1 Short Circuit
3.9 direct Constants
3.9.1 Index
3.10 bitwise operators
3.11 Shift Operator
3.12 ternary operator if-else
3.13 string operators + and + =
3.14 common mistakes made by operators
3.15 type conversion Operator
3.15.1 tail truncation and rounding
3.15.2 upgrade
3.16 java does not have "sizeof"
3.17 operator Summary
3.18 conclusion
Chapter 4 control Execution Process
4.1 true and false
4.2 if-else
4.3 Iteration
4.3.1 do-while
4.3.2
4.3.3 comma Operator
4.4 foreach syntax
4.5 return
4.6 break and continue
4.7 The Notorious "goto"
4.8 switch
4.9 conclusion
Chapter 4 initialization and cleanup
5.1 use the constructor to ensure initialization.
5.2 method overload
5.2.1 Method for distinguishing Heavy Loads
5.2.2 heavy load involving basic types
5.2.3 distinguish between overload methods with return values
5.3 default constructor
5.4 this keyword
5.4.1 call the constructor In the constructor
5.4.2 meaning of static
5.5 cleanup: final processing and garbage collection
5.5.1 use of finalize ()
5.5.2 You must clean up
5.5.3 termination conditions
5.5.4 how the garbage collector works
5.6 initialize a member
5.6.1 specify Initialization
5.7 constructor Initialization
5 ...... remaining full text>
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.