1. About Type conversions
Two values for a two-dollar operation, the following conversion action occurs: if one of the two operands is a double type, the other operation is converted to a double type. Otherwise, if one of the operands is of type float, the other will be converted to the float type. Otherwise, if one of the operands is of type long, the other is converted to a long type. Otherwise, the two operands are converted to the int type. 2. About overriding and overloading overloads (overload): As long as the method name is consistent, the other (parameter list, return value) is arbitrary. Rewrite (overriding): Only implemented function code is inconsistent, the other (function name, parameter list, return value type) must be consistent. The 3.string class and the StringBuffer class StringBuffer class call the ToString () method and convert to a string type.
There is no append () method in the string type.
You can copy a string directly to a variable of the declared Stirng class, but not to the StringBuffer class. The string class cannot be changed, but can be shared, and the StringBuffer class can be changed. 4.toUpperCase () toUpperCase () checks the current object if no conversion is required to return the current object directly, otherwise new object is returned. 5. About JVM heap memory overflow Simply, Java's heap memory is divided into two blocks: Permantspace (persistent band) and heap space. The persistence belt is mainly used for storing static type data, such as Java Class, Method, etc., and the garbage collector to collect the Java object is not very related. And Heapspace is divided into young and old generation of garbage collection called Young GC, old generation garbage collection called Full GC. Objects that survived after N (configurable) garbage collection in the young generation are copied into the old generation. Therefore, it can be considered that older generations are storing objects with longer life cycles. Old generation overflow causes there are tens of thousands of string processing, the creation of thousands of objects, in a piece of code to apply hundreds of m or even upper G memory. Persistent generation overflow is caused by a large number of dynamically loaded Java classes that cause overflow.
Java Daily Tour 2