java - About the references and values in OOP -


in program, variables "r" or "m" of circle_b points variables of object circle_a or have values (no point object) ??

class circle {     public int r;     public int m;      public circle(r, m)     {         this.r = r;         this.m = m;     }      public getr() {return r;} }   main: circle circle_a = new circle(10, 20); circle circle_b = new circle(circle_a.getr(), circle_a.m); 

edited:

class myclass {integer var;} myclass = new myclass(); a.var = 5; myclass b = new myclass(); b.var = a.var; 

b.var points a.var or has selfvalue (b.var = 5)?

these variables int, primitives, they're stored values, see doc


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -