static variable vs non static variable

前端 未结 4 866
遥遥无期
遥遥无期 2020-12-20 08:37

I have defined an object and declared a static variable i. In the get() method, when I try to print the instance and class variable, both print the

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-20 09:37

    you didn't declare any instance variable in here.only one static variable.if you declare instance variable without assigning value,then if you try to print that instance variable value using "this" key word you can get default value as 0.

提交回复
热议问题