#code not compiling
1 messages ยท Page 1 of 1 (latest)
โ This post has been reserved for your question.
Hey @shadow igloo! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
you aren't calling new Point
you had the parentheses before, why did you remove them
you also had a ; after y=b
why are you removing code that works?
and make sure you've saved
you have another missing ;
yes
U really sure that u are running this file?
your errors point to Point.java and Main.java, which are clearly both not this file
yes why
this is my first prog in java lmao do u mind explaining what exactly this means
you aren't running this file
Read the error message. The problem is at Point.java 5th line. And you are using it on Main.java 11th line, thats what the error message is saying.
You probably missed another ; around Point.java 5th line...
i unserstand that but there is no ; missing
Sir u have a file that is named Point.java and one Main.java?
What? ๐ญ
I have a file named demonstration_21
In this case you are running the wrong java file.
how do i run the right one then?
right click run file ๐ค
or if u have java added to path variables then use ur terminal
๐ค Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
U didnt solve it till now?!
nope
Can you send us the whole code so we can run it at least?
class Point{
int x,y;
void GetPoint(int a, int b){
x=a;
y=b;
}
}
class Demonstration_21{
public static void main (String args[]){
Point p = new Point();
p.GetPoint(5,10);
System.out.println(p.x);
}
}```
oh where was this i didnt see rip
also ik it works bc i used an online compiler to check, i want to use vscode though but am not able to figure out whats wrong
๐ญ
?
- Rename your method because it's strange. It's not getting the points, it's setting them, or changing...
- use terminal
go to the folder that conatins your Demonstration_21.java file
right click - open terminal here
GetPoint?
Yes, your method is changing those points based on what values you give to the method, not getting them.
Sounds strange... Change it to setPoints
am i blind or is there no open terminal ๐