Passing Variables between methods?

前端 未结 5 1840
情书的邮戳
情书的邮戳 2021-01-17 00:10

So im trying to write a simple java program for college and I\'m a complete newbie at this java stuff. I keep getting an error when I compile, \"error - could not find symbo

5条回答
  •  独厮守ぢ
    2021-01-17 00:57

    variables declared inside any method are for that method only(local scope). Either declare those methods at class level or pass them as arguments from main(as per use case, if methods being called from main).

提交回复
热议问题