John Meyer

Greenhorn
+ Follow
since Feb 14, 2015
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by John Meyer



 
Expected Output:

[blah, pah, foo, f, fp, fpr, Fortuna]
[blah, pah, Fortuna]


Actual Output:

[blah, pah, foo, f, fp, fpr, Fortuna]
[blah, pah, foo, fp, fpr, Fortuna]

The first paragraph states "This would be a nice way of filtering the data in a list." This is false as the predicate
tests if the list entry is prefix to the string "abc"; it does not filter the list on "abc[*.]".  The method startsWith() is of input string
"abc", and not of the list element.   This would be useful as a only to determine which elements are valid prefixes of the input string.

Such a filter can be created using a BiPredicate lambda expression, but as it requires code beyond the method itself, it would not be a way to demonstrate a method reference that could be passed to removeIf().
We could replace the sentence with a clarification that it's more of an academic exercise as a way to check if the list entry is a valid prefix of "abc".  Or, the statement could
be removed, thus preventing the confusion evidenced in this 2016 coderanch post.


Is there a place to connect with other Ruby learners who are at the same/similar level for regular online meetings and a closed mail list? I'm planning to learn a lot of pure Ruby this year (no rails emphasis) and it would be great to work together with 6 or 7 people at the same level.

Many thanks
8 years ago

Roel De Nijs wrote:

John Meyer wrote:The UX is work in progress, but it's better than the tool that ships with the SE7 guide. Being web based maybe they can make corrections.


I agree online exam software comes with some great benefits. The most important one is you can easily apply fixes and corrections (as shown by Enthuware for example).

I assume you are referring to the practice exams of the K&B7 study guide. I don't have real complaints about the UX of the practice exams. I especially likethe grade exam page: you clearly see which questions were (in)correct, you have a very straightforward indication of which answers you had to select to answer the question correctly and you have the explanation of the correct answers at the bottom.



Yeah - UX is actually ahead of sybex site, except in my case, because on the 7 guide, the Adobe installer failed.

Roel De Nijs wrote: user interface seems a bit misleading/confusing to me



You have to show a modal dialog to see the answers... which hides the question. The UX is work in progress, but it's better than the tool that ships with the SE7 guide. Being web based maybe they can make corrections.

Roel De Nijs wrote:I wonder why answer C is incorrect.



Good catch. C actually is correct per the test app. If you miss any part of a question, the app puts a red x next to all your answers, including the correct ones.
This is one of the practice questions in the otherwise formidable OCA SE8 study guide. While the practice quiz shows option B as true, I think it's likely on the real exam it would be false. The question appears to be getting at distinctions of classes and objects.



B is not true because:

1. Objects are bytecode, instantiated in memory. Classes are recipes for building objects.
2. Methods can be passed the following: 1) references to in-memory objects 2) primitives, 3) null values. Class types may be specified as parameters, but classes may not be passed as parameters. [Reflection would be a possible exception to this statement, but would not go anywhere to resolving the other issues.]
3. Objects cannot serve as superclasses because classes, not objects, are what provide inheritance and other polymorphic features.

I think it could be correct if it were reworded as follows:

B. If a method defines a parameter for a superclass that has three subclasses, then instances of any of those three may be passed to the method.