码迷,mamicode.com
首页 > 编程语言 > 详细

java方法返回值的变量类型困惑

时间:2017-06-10 10:49:54      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:cut   blank   ret   而不是   turn   eth   this   为什么   成员变量   

一、java program progress of excuting:show in next picture

技术分享

       How about the java virtual machine is it,what situation is in the jvm,or how to worke is going?

       If you want to slove these questions,please read the next picture:
技术分享技术分享


二、Why can java return local varieties?

      As we known that the local varieties are stored in the stack(global varieties are in dull),and they will be destroyed when the method excuted.

     then my confuse also conducted,although this local varieties have been destroyed,i understand that the varieties of method in jvm had been clear,then,why could not void method return a local variety?

就是为什么java非空method能够返回method的局部变量,而不是必须是成员变量?


java方法返回值的变量类型困惑

标签:cut   blank   ret   而不是   turn   eth   this   为什么   成员变量   

原文地址:http://www.cnblogs.com/tlnshuju/p/6977793.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!