سلام
اگر کلاس به تابع ارسال شود ارسال از طریق مرجع است مثال:
/*
* Main.java
*
* Created on April 5, 2005, 8:07 AM
*/
package prg1;
/**
*
* @author tavakol
*/
public class Main {
/** Creates a new instance of Main */
public Main() {
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
NewInt aa = new NewInt();
aa.Value = 10;
Add1(aa);
System.out.println(aa.Value);
}
public static void Add1(NewInt b)
{
b.Value++;
}
}
class NewInt {
int Value;
}