About Question enthuware.ocpjp.v7.2.1095 :
Moderator: admin
-
- Posts: 20
- Joined: Fri Jun 19, 2015 9:17 am
- Contact:
About Question enthuware.ocpjp.v7.2.1095 :
Option 2 requires moving A.java file to another directory whereas a question only offers inserting something to a line 1.
-
- Site Admin
- Posts: 10113
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1095 :
No, you can keep a java file anywhere you want. There is no need to move it. It is the class file that has to be in a certain directory (as per the package).
If you like our products and services, please help us by posting your review here.
-
- Posts: 20
- Joined: Fri Jun 19, 2015 9:17 am
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1095 :
Well, but if there is no package declaration then the default package is implied, and when you add a package declaration, say, package a.b, the file must be moved to a/b subdirectory of initial location. Or, you have to update your compilation options so that the A.java now can be found in a/b relative to sources dir. Anyway, when you change package declaration in a source you have to update yet another thing, either files structure or your pom.xml or build.xml or alike. Have you got my point now?
-
- Site Admin
- Posts: 10113
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1095 :
Yes, I got your point but which tools and utilities you use is not Java's resposibility. The restrictions that you have mentioned are imposed by third party tools, not by Java. As far as Java is concerned, your source file can be anywhere. It doesn't care. It cares only about the class file.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 11 guests