Page 1 of 1

About Question enthuware.ocpjp.v7.2.1095 :

Posted: Tue Jun 30, 2015 10:24 am
by Alexey Berezkin
Option 2 requires moving A.java file to another directory whereas a question only offers inserting something to a line 1.

Re: About Question enthuware.ocpjp.v7.2.1095 :

Posted: Tue Jun 30, 2015 9:05 pm
by admin
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).

Re: About Question enthuware.ocpjp.v7.2.1095 :

Posted: Thu Jul 02, 2015 4:02 am
by Alexey Berezkin
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?

Re: About Question enthuware.ocpjp.v7.2.1095 :

Posted: Thu Jul 02, 2015 5:18 am
by admin
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.