Win a copy of Java Challengers this week in the Java in General forum!

Terrence Lee

Greenhorn
+ Follow
since Mar 06, 2021
Terrence likes ...
Spring Java Linux
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
3
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Terrence Lee

So learning a natural language is equivalent to learning a programming language?
1 week ago
From the section titled, "If you can learn French, you can learn Python!"
I was wondering why French?
And is the inverse true, that is, if you can learn Python, can you learn French?
1 week ago
From my little experience in planning for OCP11, I don't think that it's possible to successfully get any certification on work experience alone.

Also concerning, is the distinction you draw between Spring Boot and Spring Framework.  Boot doesn't exist without the core framework, so by inference, you should already know about it.
4 weeks ago

Jesse Silverman wrote:One of the only things I learned from the first section of the course, which I think the Enthuware 815 material had pointed out, was that you can no longer start variables with _.
On the quiz for section one, they had 'which variable name is illegal?' and there was a choice that began with a numeric digit, and another that began with an underscore.

I guessed the question was out of date, so since it would only let me mark one, I chose the one that began with a numeric digit.

So far, the content is _whelming.

I appreciate that it is being offered for free, and appreciate our friends at Sybex, Enthuware and the host of people helping to educate others for free even more than before.



Jesse, a single underscore is illegal since Java 9.  You are still allowed to start a variable name with _ or $.
For example, in Java 8, this compiles:
int _ = 1;
but with a warning: (use of '_' as an identifier might not be supported in releases after Java SE 8)
The question mixes PreparedStatement and executeQuery(String s), it will compile but throw a SQLException at runtime.  Hackers can't exploit code that doesn't run (or maybe they can?)


try (var stmt = conn.prepareStatement(sql)) {
...
   try (var rs = stmt.executeQuery(sql))

J Noot wrote:Hey!

Does anybody know what happens if I fail the exam - will I still be able to schedule next exam for 25$?
Let's say I try to take the exam next week and fail. I have more than a month to re-study and be able to take the exam before April 25. Is it possible though or is it one time offer?



The terms and conditions say "Valid only for one exam attempt per subscription."
This review question is about Files.move(), the answer says:

Next, the NOFOLLOW_LINKS option means that if the source is a symbolic link, the link itself and not the target will be copied at runtime



The Java API doc says this about move()

If the file is a symbolic link then the symbolic link itself, not the target of the link, is moved.

 It goes on to say that the options parameter may include ATOMIC_MOVE and/or REPLACE_EXISTING.

My suggestion is to update the answer explanation to remove NOFOLLOW_LINKS because the move() method will ignore it.