Posts

Showing posts from April 22, 2019

get some object of one class and use in another class

Image
0 I want to use some object of one class and use in other class,but i can not for example : class 1: public class Value { private double radious; private double lenght; public void setRadious(double radious) { this.radious = radious; } public void setLenght(double lenght) { this.lenght = lenght; } } question : how can I use just radious of class 1 in class 2??? class 2: public class calculateArea { private Value value; public double area() { return 3.14*radious*radious; } } java share | improve this question edited Nov 22 '18 at 12:41