Hi guys. I am a newbie in this forum. Hope I can find an answer here.
I watched Mosh’s beginner Java tutorial on Youtube and tried out reference type today. But there is a bug in running Mosh’s example on my Windows 7 computer, as shown in the screenshot. Does anyone know how to fix the issue? I have already followed Mosh’s steps in writing the code.
Thanks a lot!
I think the problem is near those red squigglies. Maybe it should be
Point point1 = new Point(1, 1);
yes yes it works now. Intellij automatically adds “x:” and “y:” before the two numbers.
Thank you so much eelsholz!
I face the same problem, I use visual Studio code and extensions.
There can be only one public class per source file. You have to put it into another file to avoid this.
If the class is in the same package or equivalently in the same source directory, you don’t have to import it.
Pretty sure that has nothing to do with this particular issue.