Why does VS.net let you use System.Math.Abs(double) without creating a new instance of it (System.Math math = new System.Math)? Ive been trying to make my own class that will find the area of circle, but it makes me create a new object first (ADGMathPro.Circle circle = new ADGMathPro.Circle();
What I was it to be able to do this....
ADGMathPro.Circle.Area(34);
instead of
circle.Area(34);
VB Code:
namespace ADGMathPro { /// <summary> /// Summary description for Circle. /// </summary> public class Circle { const double pi = System.Math.PI; public double Area(double radius) { double area; area = pi * (radius * radius); return area; } public double Circumference(double radius) { double circumference; circumference = 2 * pi * radius; return circumference; } } }
What am I doing wrong??
Thanks




Reply With Quote