Yin Stadfield wrote:
Ted North wrote:"A static member can call/access only a static member of its own class" (Ganesh & Sharma, 2013, p. 488). Does this mean that a static reference can only call methods in its class or call fields in its class using the name of the class and the dot operator?
Hi Ted,
If I understand your statement correctly, I'll say this is not the case: Does this mean that a static reference can only call methods in its class or call fields in its class using the name of the class and the dot operator?
Because if it is within the class itself, you won't be needing to use the class name + dot operator. Example:
You can't however, call an instance members from a static reference:
Sergej Smoljanov wrote:I think this assume word access directly .
you can access static members of other class use type name and dot and name of types static member. and also you can create instance of class and access non static member of instance
Ankit Garg wrote:Directly the fork() method doesn't call the compute() method, fork() submits the task to the worker pool. You can check the source code
To backtrack, I think you can check ForkJoinWorkerThread.execTask method, which calls ForkJoinTask.doExec which calls RecursiveTask.exec where compute() method is called
Ankit Garg wrote:
Ted North wrote:My question is: What is the fork() method doing in the program? Is it recursively calling the compute() method or is it summing up the numbers without making sure the value is not too large in the first if statement in the compute() method. That if statement is: if ( (to - from) <= N/NUM_THREADS)
Hi Ted, the fork method calls the compute method asynchronously. The recursive behaviour is defined in the compute method itself...
Jeanne Boyarsky wrote:
Ted North wrote:Do the two dots mean to move back one directory to the previous directory, which is just above the 'programs' directory? So since the path is going into the 'programs' directory then directly out of it with the double periods the normalize() method removes it?
Exactly.
Ted North wrote:For instance in a BASH shell typing: cd ../ will move back one directory. Where as cd <directory-name> moves to the typed directory.
This is even stranger because I rarely use Windows any more and the question is with a Windows file system.
Stick with that mental model. cd .. works on Windows too. Really, it does. Java tries to be platform independent so you can switch the directory path separators. Which means I could write c:/OCPJP7 and Java will be happy as a clam.
Rico Felix wrote:
Ted North wrote:What is the operator that determines if three numbers appear, two numbers, or just one since an IP could be 192.168.300.300 or 192.168.1.1 etc?
[01]?\\d\\d? is used to get one digit or two digits or three digits since two digits are optional...
Rico Felix wrote:
Henry Wong wrote:For large regexes, it is generally a good idea to break it down to it's components.
That is exactly what you must do to make sense of long regex's...
We start with "\\b((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)(\\.)){3}(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\b" and move left to right just like the regex engine would:
Seeing that you have a fair amount of knowledge on regex's from your last post (the image), skipping over the obvious parts we decipher through the non-obvious
25[0-5] translates to 250 min to 255 max
2[0-4]\\d translates to 200 min to 249 max
[01]?\\d\\d? translates to 0 min to 199 max (remember ? mean 0 or one)