patrick avery

Ranch Hand
+ Follow
since Sep 12, 2008
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by patrick avery

Also, keep the cap on the marker between uses....I left mine off for 5 minutes and it dried up and I could not write anything!! Little things can mean the difference between pass or fail!!!
I just completed the SCJP test early this week and I wanted to warn those who have not yet taken the test of a pitfall that I encountered.

During the test as you go thru the questions you can skip any question and when you get done with the whole test you are presented with a recap of all questions showing those you answered, those you skipped, and those you checked for review.

The pitfall is that the Drag and Drop questions don't show any indication that you skipped them or or not.

In my case, I knew that I had skipped one or two Drag and Drop questions, so I had to go thru every one of them again to see which ones I had skipped.

Here is the killer. When you go back to review a Drag and Drop question, it doesn't show you your answer or whether or not you gave an answer, it warns you that if you open up the question again your previous answer will disappear and you will need to answer the question again from scratch.

So, I lost valuable time because I ended up re-answering from scratch every Drag and Drop question a 2nd time just to be sure that I found the 2 that I thought I had skipped.

So, be sure to take note of any Drag and Drop questions that you skip, so that you know which ones you can safely open up again without losing time by erasing previous good answers.

Good Luck, Pat Avery

Thanks Sachin!

I noticed that you have SCJP and are preparing for SCWCD and SCBCD.

I think it makes sense to skip SCJD (I assume you are), since it's more expensive and SCWCD and SCBCD would seem to cover much more new territory than doing the SCJD project.

I think I will focus on SCWCD next....do you have any good resources that you could pass along (besides the Saloon Web Component Certification (SCWCD) forum, of course.

Thanks, Pat

15 years ago
I just passed passed SCJP 6 with 88%

Here was my breakdown:

Declarations, initialization and scoping - 83 %
Flow control - 100 %
API Contents - 90 %
Concurrency - 87 %
OO Concepts - 90 %
Collections / Generics - 90 %
Fundamentals - 81 %

I guess the biggest suprise for me was how easy it was compared to all of the mock tests I have been doing. I have read lots of commentary in the Saloon forums that say that you should hit about the same % in your real exam that you are getting in the mock exams. I found the mock exams much harder and trickier than the real thing.

(By mock exams I mean
the K+B Master exams,
the exams in their book,
the Examlab software,
Examulator, Inquisition,
and the exams @ http://nikojava.wordpress.com/)






15 years ago
John...to clarify your final example....................



In this case we can specify:
2. return new ArrayList<Number>();

rather than
2. return new ArrayList<T>();

Is this because Number is the only class that satisfies both <T extends Number> and <? super T> so, there is no ambiguity at compile time as to what
T could be?. While in the prior examples (without the <T extends Number> and <? super T> combination), T could not be known at compile time so the return statement had to return List<T> rather than List<Number> ?

This is from ExamLab..........



The result is
[1] D, [1] E,

However, I am confused by the (\\d) in the text of the Pattern???

1 - what is the significance of the parentheses? It seems to work the same with or without them i.e. these both work the same:
Pattern pt=Pattern.compile("\\s[a-fA-BD-G](\\d)?");
Pattern pt=Pattern.compile("\\s[a-fA-BD-G]\\d?");
2 - why doesn't the (\\d) force the match to include a digit, i.e. instead of ' D', it should require something like ' D7' ??

In case this is not clear, I mean to say that I would expect a valid match to include all 3 components, i.e.
\\s a space
[a-fA-BD-G] a letter
(\\d) a digit

Why do ' D' and ' E' match?
In a recent post the issue came up about taking the test late on a Friday after working hard all day....I have not taken exam yet but I plan to take it early in the morning after a good night's sleep...I really think this can help, because I know my mock test preparation goes better early in the AM than after working or studying all day.

Also, I have noticed in my Mock test preparation that I am seeing more and more instances of missing questions not because I don't know the answer, but because I misread the question or the code and missed some small but critical thing.

Here is a check list of the types of obvious but critical things I am trying to remember come test taking time to protect myself against missing question that I should get correct.

Additions to the list are most welcome.

-- Read question very slowly and carefully and more than once
-- Avoid tendency to jump to conclusions about what is asked
-- Watch for opposites like will 'compile vs will not compile'
-- Watch for words like 'always' and 'never'
-- Read answers first then study code
-- if 'does not compile' is an option, study legality of code before purpose of code
-- Drive you analysis from the main method
-- Watch for method calls that throw checked exceptions not getting caught of handled
-- Watch for subtle mixing of primitives + wrappers in code like boolean and Integer
-- Watch for what is missing...seem to get tripped up by missing modifiers, return types, etc.
-- Watch for enum constants with arguments, means an enum constructor that takes a parm must be supplied
-- Watch for effect of parentheses in expressions
-- Watch for attempts to execute nonstatic methods from static main
-- Watch for interface methods with no modifiers (really public, abstract)
-- Watch for interface fields with no access modifiers (really public, final, static)
-- Watch for so-called methods without return types
-- Watch for < vs <=
-- Watch for functions that throw exceptions outside a try/catch block that should be in one
-- Watch for functions that throw exceptions inside a finally clause
-- Watch for illegal use of keywords like 'goto' and 'const'
-- Watch for illegal use of length or length() between arrays and other classes
-- Watch for Compile time error, caused by unreachable code
-- Watch for using extends where implements is needed or the reverse
-- Watch for subtle punctuation changes, like int i; int j=10, int k=10;
-- Watch for wrong case on keywords, variable names, + class names like Int i3 = new Integer(10);
-- Watch for keywords used a variable names like int do = 10;
-- Watch for check for wait, notify, notifyAll not run from synchronizedsynced context
-- Dissect the overall structure of the code sample first, i.e:
classes
constructors
static members
methods
variables
-- When 'compilation fails' is an option use this checklist to find subtle errors:
scope violations
static vs non-static violations
missing modifiers or return types
check class defs
check constructors
check methods
check variables
check for checked exceptions not caught
assert statements returning void
code slipped in between try, and catch and/or finally blocks

Additions to the list are most welcome.
Does this look correct? 5 created, 3 referenced, 2 ready for GC

In the Master Exam I came across a question with some code containing 2 assert statements. The text of the question did not reference the assert statements and did not indicate that asserts had been enabled...it just asked "What is the result?"

2 questions:

1 - for the exam if the code contains assert statements but nothing is said about whether or not they are enabled should we assume that they are not?

2 - if asserts are not enabled does this mean they will not be executed or only that they will execute but not cause an assert exception?
Thanks for the great feedback.

I think this makes more sense if you consider it as a case of the rule that says "you can't widen then box"

i.e.
Why are there inconsistencies like this regarding Wrapper instantiation......is there a general rule that would help in understanding the inconsistencies?

Example:
Ruben:

I ran a few tests and this seems to hold true...

List myListb = new ArrayList<String>(); // type unsafe collection
List<String> myListc = new ArrayList(); // type safe collection
Usually generics questions have declarations like the following:



I think I understand how this works to provide type safety to collections at compile time.

However, these 2 variations also compile, but I am unclear on what behavior differences would be seen in these cases?

I don't think that the first case
(#1) Object z = t.findLarger(123, "456");
will become t.findLarger(Object,Object).

First of all, Object does not implement Comparable so it would not work with findLarger's definition i.e.
public <T extends Comparable> T findLarger(T x, T y)

Secondly, if you add 2 getClass().getName() displays and run the code it shows that the two parms are coming in as Integer and String, i.e.



WrapperCheck class of x java.lang.Integer
WrapperCheck class of y java.lang.String

Note that you must comment out the compareTo logic as it fails at runtime.
[ December 12, 2008: Message edited by: patrick avery ]
If you use scanner.next(), it will read the whole file: