I:1: If the parameter is of the basic data type (four types and eight types: byte, short, Int, long, double, float, double,Boolean, char), then the value of the variable is passed, for example: int A = 10; then the passed value is 10! Example:Package qqwwffg. pass_method_paramater;
Public class primitivetype {Public void change (int ){A = 3;}Public static void main (string [] ARGs ){Int A = 1;Primitivetype
Deep Copy Part code:C # entity class serialization and deserialization one (XmlSerializer)C # entity class serialization and deserialization two (DatacontractserializeR) Copyright: jiankunking Source: http://blog.csdn.net/jiankunking This article is copyright to the author and Csdn, Welcome to reprint, but without the consent of the author must retain this paragraph, and in the article page obvious location to the original connection. C # Object Comparisons (value
Convert string type to byte[]:byte[] ByteArray = System.Text.Encoding.Default.GetBytes (str);Byte[] turn into string:String str = System.Text.Encoding.Default.GetString (ByteArray);The string type turns to ASCII byte[]:("01" turn into byte[] = new byte[]{0x30,0x31})byte[] ByteArray = System.Text.Encoding.ASCII.GetBytes (str);Asciibyte[] turn into string:(byte[] = new byte[]{0x30, 0x31} turns into "01")String str = System.Text.Encoding.ASCII.GetString (ByteArray);Byte[] Go to 16 binary format str
[] to store data, there is an extended process when writing data, meaning that the length of the stream is not the length of its byte[] field. And GetBuffer returns is byte[] This field. Here is a partial implementation of GetBuffer, perhaps read this will be more clear: public byte[] GetBuffer () {return this._buffer;}Here's how ToArray is implemented:Public byte[] ToArray () {Byte[] bs = new Byte[this._length-this._origin];for (int i = this._origin, j = 0; i Bs[j++] = This._buffer[i];return BS
Value type
Reference type
Memory allocation Locations
Allocation in the stack
Allocating in the heap
Efficiency
High efficiency, no address translation required
Low efficiency, requires address translation
Memory Recycling
When you're done, recycle it now.
Not immediately recycled after use, waiting for GC to recycle
Assignment operation
Make a copy, create a new object of the same value
Just
ImportJava.util.Scanner; Public classscannerinttest{ Public Static voidmain (String [] args) {intnum1,num2; NUM1= Getintnumber ();//Call Function Getintnumber () to get an integer entered from the keyboardnum2 =Getintnumber (); System.out.println ("First number" +num1+ "-----" + "second number" +num2);//print the two int integers you entered } Public Static intGetintnumber () {intIntnumber;//the definition returns the required int integerString strtest;//define strtest to make type judgme
2 reference typesIncludes class classes, interface interface, representing delegate, arrays arrayClass 2.1For value types, each variable directly contains all of its own data, creating a region in memory for each variable, and for reference types, each variable stores only a reference to the target data, and each variable creates a pointer to the target data. Public Static voidMain () {//structureSc
value of the argument can only be passed to the parameter, and the value of the parameter cannot be passed to the argument in reverse. Therefore, during a function call, the value of the formal parameter changes, and the value in the argument does not change. 】Because the A1 method, Ppp=new person{name= "Harry"}, the operation of the parameter PPP address changed, not the reference address of P1. This results in no effect on the P1 of the arguments.Compare A2. The reference address for PPP and
Convert string type to byte[]:byte[] ByteArray = System.Text.Encoding.Default.GetBytes (str);Byte[] turn into string:String str = System.Text.Encoding.Default.GetString (ByteArray);The string type turns to ASCII byte[]:("01" turn into byte[] = new byte[]{0x30,0x31})byte[] ByteArray = System.Text.Encoding.ASCII.GetBytes (str);Asciibyte[] turn into string:(byte[] = new byte[]{0x30, 0x31} turns into "01")String str = System.Text.Encoding.ASCII.GetString (ByteArray);Byte[] Go to 16 binary format str
type is converted to String type:" +g);//long type is converted to string type long j=123342; String j=string.valueof (J); System.out.println ("Long is converted to String type:" +j);//object type is converted to string type Object k=c; String k=string.valueof (K); System.out.println ("ObThe ject type is converted to String type: "+k"; System.out.println ("\ n");//double type to long type double P=88.88;long p=math.round (d); System.out.println ("Double type to Long type:" +p);p =p; Force typ
Address: http://www.codeproject.com/KB/dotnet/6importentStepsDotNet.aspx
This is because it is relatively simple.
Not all translations will be made when the configuration is complete.
Here we translate a boxing and unboxing:
When the data moves from value types to reference types its termed as 'boxing' and the vice versa is termed as 'unboxing '.
When converting a "data" from a value type to a refe
We all know the value type and reference type, but in fact, although string is a value type, it is a little special String is a reference type. Both str1 and str2 point to the same memory address. The str1 value is modified, and the str2 value is also affected! However, we will find that the str2 value is not affected after the str1 value is modified. This is because. net Framework performs special processing on the string. When the content of the string changes ,. net will allocate a new memor
1 Packagecom.liu.u6.copy1;2 /*3 * What is the difference between a basic data type and a reference data type4 */5 Public classSJLX {6 Public intAge ;7 }8 Packagecom.liu.u6.copy1;9 Public classTESTSJLX {Ten Public Static voidMain (string[] args) { OneSystem.out.println ("*********************** basic data Type *********************8"); A intNum1=3; - intNum2=5; -System.out.println ("num1 Original value =" +num1); the //assigns the value of the NUM1 to num2 -
Javascript implements code instances similar to asp data dictionary data types, js Data Types
First declare an array:Copy codeThe Code is as follows:Var dictNew = new Array;
Var key;
Var value;
For (var I = 0; I
// Obtain the key-value pair to be added to the data dictionaryKey = jQuery ("# costCodeIdId" + I). val ();
Value = num2zero (jQuery ("# valueId" + I). val ());
// Check whether the key value exist
PHP generates three types of code instances for short URLs, and php generates three types of instances.
The short URL service may be no longer unfamiliar to many of my friends. Now, there are many application modes in most Weibo, mobile phone email reminders and other places, and they occupy a certain market. It is estimated that many of our friends are using the service now. I have read Sina's short Connec
Java language-differences between three types of loop statements and java-three types of statements
------- Android training, java training, and hope to communicate with you! ----------
First: for LoopLoop Structure for statement format: for (initialization expression; conditional expression; Operation expression after loop) {loop body;} eg:
1 class Dome_For2 {2 public static void main (String [] args) {3
Basic data types based on JAVA, java Data Types
Basic Data Type:1. numeric type 1) integer: 1. byte: one byte, eight digits. value range: 0 ~ 255, used to store binary data. 2. Two short bytes, 16 bits. The value range is-32768 ~ In the range of 32767. 3. Four int bytes, 32 bits, value range:-2147483648 ~ The value range is-2147483648. The value range is-9,223,372,036,854,775,808 ~ Between 9,223,372,036,85
The most important four types of tables in DedeCMS and four types of tables in dedecms
Topic (category): dede_arctype (dede Database Designer thinks: No matter what data you store (software, product, movie...) should belong to a certain topic (type ))
Content master table: dede_archives (the zhimeng Database Designer believes that all content pages will have the same field)
Content attachment table dede_
13 types of uml and 13 types of uml
1. Use Case chart: Classification of the system usage.
2. Class diagram: displays the relationship between classes and them.
3. Object graph: displays only objects and their relationships.
4. Activity diagram: displays activities of a person or object in a way similar to a flowchart.
5. State Machine diagram: displays various states of objects with interesting or
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.