logo

什么是局部变量(Local variable)和实例变量(Instance variable)?

What is meant by Local variable and Instance variable?

题目类型: 技术面试题

这是一道技术面试题,常见于澳洲IT公司面试中。

难度: medium

分类: Java

标签: local variable, instance variable, scope

参考答案摘要

答案 局部变量(Local variables)定义在方法内部,其作用域仅存在于该方法内部。 variables that have existed inside the method itself. 实例变量(instance variable)定义在类内部、方法外部,其作用域贯穿整个类。 and scope of the variables exist throughout the class...

本题提供 STAR 原则详细解答和技术解析,登录匠人学院学习中心即可查看完整答案。

← 返回面试题库

什么是局部变量(Local variable)和实例变量(Instance variable)?

Mediumjavavariables

想查看完整答案?

登录匠人学院学习中心,获取 STAR 格式回答和详细技术解析

前往学习中心查看答案