Compile and execution w/packages involved

Oracle Certified Foundations Associate Java Certification Questions and Discussion
1Z0-811

Moderator: admin

Post Reply
aks0961
Posts: 12
Joined: Sun May 28, 2023 1:17 pm
Contact:

Compile and execution w/packages involved

Post by aks0961 »

Hi, I'm on chapter 4.5.1 and learning about compiling and executing a program via the CMD when there are packages involved and I was also watching a video for this topic on youtube and just had a question.

So in the youtube video, he does it as follows:

Javac -d . Hello(this is the class he used).java

then he does

Java one(this was his package).Hello

As you can see, the first line he inputs into the CMD is exactly what you said to do in the book. But if you look at the second line, while it is similar, he doesn't add "-classpath ." before doing the package.class format... and this is what you put in the book.

Just wanted to reach out and have this question rectified!

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: Compile and execution w/packages involved

Post by admin »

What is the question? The book shows the right and complete way.
If you like our products and services, please help us by posting your review here.

aks0961
Posts: 12
Joined: Sun May 28, 2023 1:17 pm
Contact:

Re: Compile and execution w/packages involved

Post by aks0961 »

In the video I watched, the person did almost the exact same steps as you, like I outlined above, but you added the "-classpath ." while he did not, and still compiled and executed the program

I know on the next page you mentioned what "-classpath ." is but I wasn't able to really grasp what it does so just wanted your help on it

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests