Simple square root problem!
This is my first time posting. I'm brand new to programming but have taken it upon myself to study a Java programming course. However; I'm stuck on a simple little problem, I'm quite ashamed about this :o
I have 2 classes: MyMath and Squares
I have to return the square root of a value passed into the MyMath class from the Squares class and print it to the screen.
The object of this excercise is to get used to static methods, to be able to use methods within a class without the need to instantiate an object.
But as you can guess by now, it ain't working.
Here is the code:
public class MyMath
public static long square(int a)
long b = a*a;
public class Squares
public static void main(String  args)
MyMath class compiles but Squares does not. Can someone point me in the right direction please? No doubt it will be a really simple answer.