r/javahelp • u/[deleted] • Jul 27 '22
Need help with this code
I am trying to create a class called point which will have an x and y as coordinates however error squiggles show up and it's not running can someone point out the problem btw the code is not complete
public class Circle_class {
class Point(int x,int y)
{
int x;
int y;
x = x;
y = y;
}
class circle
{
double radius;
Point center;
}
}
0
Upvotes
4
u/ryosen Extreme Brewer Jul 28 '22
Hold your mouse over the squiggly line. A tooltip should appear that tells you something about how a class declaration can’t have parameters, only method declarations. It might even have a note cautioning you to not confuse a class declaration with a constructor.