#Package doubt

18 messages · Page 1 of 1 (latest)

proper jewel
#

package JavaProgramming16ClassObject;
public class Main {
public static void main(String[] args) {
AddTwoNum AddTwoObj = new AddTwoNum();
AddTwoObj.AddTwoNumMethod();
}

}

package JavaProgramming16ClassObject;

public class AddTwoNum {
public void AddTwoNumMethod(){
System.out.println("Print -> AddTwoNumMethod method from AddTwoNum class");
}
}

When I try to run this code in VS Code that error throws ?

still crestBOT
#

This post has been reserved for your question.

Hey @proper jewel! Please use /close or the Close Post button 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.

muted wedge
#

what's the exact command you are using?

#

Are both classes in the same directory?

proper jewel
#

Yes

#

I am not using any command , Just clicking Run code in VS Code

muted wedge
#

Did you mark the directory as a source folder? How did you configure the run button?

#

(idk VSC)

proper jewel
#

No

#

This video is about - how to set up and run a Java program in visual studio code on Windows and Mac.

Visual Studio Code installation link
👇👇👇👇
https://code.visualstudio.com/

Search "visual studio code for java" in your browser such as chrome and click on the first link.

Document of Java Language setup and Install on VS Code
👇👇👇👇
https://code...

▶ Play video
#

I think I did not start properly for setting java project

muted wedge
#

then maybe try that again?

proper jewel
#

Ok

#

I am able to run the code like this

#

Thanks

still crestBOT
# proper jewel Thanks

If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.