/*************************************** **************************************** *************
* Author: conowen @ Dazhong
* E-mail: conowen@hotmail.com
* Http://blog.csdn.net/conowen
* Note: This article is original and only used for learning and communication. For more information, indicate the author and its source.
**************************************** **************************************** ************/
First, you must understand that Java has no pointer concept.
However, you can also useArray. It is an int type, and can also be implemented using an array of elements.
You can also use global variables.
For more information, see the following simple demonstration.Code:
Package COM. conowen; import android. app. activity; import android. OS. bundle; public class testactivity extends activity {/** called when the activity is first created. * // @ overridepublic void oncreate (bundle savedinstancestate) {super. oncreate (savedinstancestate); setcontentview (R. layout. main); byte word [] = new byte [10]; int num [] = new int [1]; fun1 (word, num); system. out. println ("the last num [0] value ----->" + num [0]); system. out. println ("Last word [1] value ----->" + word [1]);} void fun1 (byte [] Word, int [] num) {// do somethingnum [0] = 2; word [1] = 'a'; system. out. println ("Num [0] value in fun1 ------>" + num [0]); system. out. println ("word [1] value in fun1 ------>" + word [1]); fun2 (Num);} void fun2 (INT [] num) {// do somethingnum [0] = 1; system. out. println ("Num [0] value in fun2 ------>" + num [0]);}
// 04-01 21:57:23. 320: I/system. out (1999): num [0] value in fun1 ------> 2 // 04-01 21:57:23. 320: I/system. out (1999): The value of word [1] In fun1 ------> 97 // 04-01 21:57:23. 320: I/system. out (1999): num [0] value in fun2 ------> 1 // 04-01 21:57:23. 320: I/system. out (1999): The last num [0] value -----> 1 // 04-01 21:57:23. 320: I/system. out (1999): The last word [1] value -----> 97