current position:Home>How to understand the memory analysis of executing another method in a JAVA method.

How to understand the memory analysis of executing another method in a JAVA method.

2022-08-06 19:02:36CSDN Q&A

//In the stack, as long as a method is encountered,
//A method stack will be re-opened.Even
//another method contained in the method will reopen a method stack.
//Please tell me, the memory analysis of the following parameters.
public class Main {
public static void main(String[] args) {
XX x=new XX();
Meth m =new Meth();

m.get(23,x); 

}
}
class XX {
public void san(int i){
for(int k=1;k
for(int n=1;n<=k;n++){
System.out.print("*");
}
System.out.println("");
}
}

}

class Meth {
public void get (int w ,XX q){
q.san(w);
}
}

copyright notice
author[CSDN Q&A],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/218/202207310344169664.html

Random recommended