support issue - offshoot from from 2.1599

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
Nisim123
Posts: 42
Joined: Mon Jan 20, 2014 2:26 pm
Contact:

support issue - offshoot from from 2.1599

Post by Nisim123 »

I have 2 issues to raise on that subject. The first one might give a satisfying answer to the question asked above about the path seperator,
an issue that took me some time to solve when facing that problem while coding.

In short, java designers says that it is more safe and secure to use the "/" (forward slash) as a path separator in any case: when coding for a Windows machine or for any other machine.

and this is what i found in our legendary KS && BB guide:
"Remember that we are using a file system–specific PathMatcher . This means
slashes and backslashes can be treated differently, depending on what
operating system you happen to be running. The previous example does print
the same output on both Windows and UNIX because it uses forward slashes.
However, if you change just one line of code, the output changes:
Path path = Paths.get("com\\java\\One.java");

Now Windows still prints:

false
true
false
true

However, UNIX prints:
true
false
true
true


Why? Because UNIX doesn't see the backslash as a directory boundary. The
lesson here is to use / instead of \\ so your code behaves more predictably
across operating systems.
"

(KS && BB guide OCA/OCP Java SE 7 study guide p. 520)



The other question i would like to ask is what can we coders actually do with the result that we get from the relativize() method as a Path object? can we actually use it as a part of another Path object in order to create a new file?
Lets say for example can we code something like the following:

Code: Select all

                                        Path p1 = Paths.get("/home/Paul/Documents/etsStudents");
                                          Path p2 = Paths.get("/home/Paul/Documents/etsStudents/OCPexamJavaSE7/NIO/RelativizeAPI");
                                          Path p3 = p1.relativize(p2);
                                           
                                         // And now lets try to create a useful path object from p3:

                                        Path p4 = Paths.get(p3.toString(), "Relativize.txt");
                                          
                                           // Now for the actual creation of the file:

                                       Files.createFile(p4);
                                 
So would that work? :roll:

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

Support issue on 2.1599 :

Post by admin »

Continued from viewtopic.php?f=2&t=2782

1. And what do your legendary KS && BB say?
You probably paid thrice as much as our simulator, so I imagine you must have asked this to them as well :D Them being legendary and all!

2. Did you try the code that you posted? What happened?

-Paul.

Nisim123
Posts: 42
Joined: Mon Jan 20, 2014 2:26 pm
Contact:

Question 2.1599 - support discussion

Post by Nisim123 »

C'mon sir, the KS && BB guide is the recommended textbook guide for this exam by you guys... examLab staff.
So I can fairly say that it was bought and ordered and eventually read thanks to you guys...
As for the price "thrice as much... etc" well, actually i got it as a gift for passing the programmer level I exam. :D

Now, as for the code above when i tried to run it... it just threw a NoSuchFileException...
actually i can imagine how the returned Path object of the relativize() method can be used esp. by 'nix' OSs,
but a sample code for that usage might be sent only upon your exquisite request..... ;)

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

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

Post by admin »

We are not examlab. We are Enthuware, if you haven't noticed.
We do recommend that book. It is a good book.

I have seen and responded to most of your queries. We have not hesitation in helping people with their queries but at the same time, we don't want to be a support staff for other people's material just because we respond to all queries to the best of our abilities.

May I request you to send me (either PM and email) your orderid?

-Paul.

Nisim123
Posts: 42
Joined: Mon Jan 20, 2014 2:26 pm
Contact:

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

Post by Nisim123 »

Yes, this is the receipt that includes the order id an license key that you've sent me when purchasing your software:
license information deleted.
BTW thanks for answering most of the questions and for the clear & sharp explanations.
It might have been good enough to study for the exam merely from your software and the discussion forums that you offer,
but as you probably know: computer- programming and esp. Java takes some time to learn, digest and implement...
So we probably should not limit ourselves only to one sole resource of information like our legendary Paul ("him being legendary and all....") :-)

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

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

Post by admin »

I explicitly requested you to send your information by either by PM or by email but you posted it here. By doing this you are pretty much giving out your license to every one in the world (because the page might be cached/archived by Google by now.) and hurting our bottom line. Do you realize how unfair this is to us? We are spending our time and energy in helping you and you are hurting our source of income..

Also, please note that our support is for 6 months after purchase only and your license is almost an year old. We will still try our best to help you out though.

-Paul.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests