Ben Harrison

Greenhorn
+ Follow
since Jan 26, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Ben Harrison

I'm starting to update my resume (Haven't done it in 2 years, and I now have my SCJP and SCWCD). I logged into Sun's website to get a logo for the resume. I clicked on logo's and nothing, it says no logos for those tests. Isn't there one generic certification image? I wanted to put it with my MCP logo.

Thanks
16 years ago
141 Given MyBean.java
public class MyBean {
public MyBean (int x) { }
}
and test.jsp
<jsp:useBean id="my" class="test.MyBean" scope="page"/>
Which of the following statements regarding the above code is correct ?
A It will work fine
B Compiler will complain because there is no type attribute specified.
C Will fail at Runtime
D It will fail at compile time



It says answer is D, but I saw another reference that said the answer is C.

I believe the answer is D, I would think the compiler would pick it up.
Thanks, that's what I thought I remembered
13 Which of the following can be used to configure the JSP container to ignore EL expressions?
A <%@ page isELIgnored="true" %>
B <%@ page isELIgnored="false" %>
C <%@ import isELIgnored="false" %>
D None of the above.

-------- Answer

D

Configuring the <el-ignored> tag inside the DD is the only way to ignore EL expressions. There was a isELIgnored attribute for page directive in the 2.0 draft version. But it is removed from the final version.
-------------

Is this true? I'm pretty sure it should be A
Thanks for all the help with some of my questions. I didn't do great, got a 68, but I know a few that I just flat out forgot the API (api memorization killed me)

I absolutely hate the fact that the drag-and-drop questions don't remember your answer, so if you go back to review the answer, you're whole thing gets reset. You'd think it wouldn't be too hard to program that drag1=spot1 or drag3=spot2... I definitly think I would have done much better on the 1.4.2 exam, mainly because I have more experience there. The new stuff gave me fits.

Anywho, onto the web cert
18 years ago
You can't return a stringbuilder or stringbuffer because you're not guaranteed that one of those objects are going to be the one "created" in the generic function. <S> could be something other than a buffer or builder -- or something that cannot be stuck into the constructor of StringBuilder, and then the return would be incorrect and not match what the method header says.
Thanks Keith, could you just explain the last two sections on the exceptions and

remember that static methods are not overridden, they are redefined. So if a static method is called, the type of reference calling the method determines which version is used. If an instance method is overridden, then the runtime type of the object determines which method is called.

Do i have this essentially right? (too much studying I am not second guessing myself)

Let's say

Class A {}
Class B extends A{}
Class C extends B{}

In function arguments you can pass to the method doIt(B b) either a B or a C, not an A

If you're returning an object in a function
public B doIt()
you can return a C, but not an A

If when you are using variables you can do:
A a = (A) new B() //need a cast?
B b = new B()
C c =new B()

also if (lets say all the classes had the same functions) there are any static methods, or if there are variables in the functions, then when you call a.getStaticMethod you actually use the values in class a, not b, or c not B, but if the overridden methods are not static, then we would use the b functions and all three would return the same value?

Access modifiers can only go "more public"
but exceptions you can only through teh same exception of a subclass correct? nothing new?

Thanks, it's getting late
I concur, I'm running on Vista and pulled their product down. No where on their site did it say that they were having problems with Vista. So I get a runtime exception so I can't use their exam. The guy did offer me a refund, but I'll deal with that after my exam tomorrow.
Thanks Keith, big help on both my questions!
So based on:

"No, because they are both references, == is reference comparison. If one of the operands were a primitive int, the other would be unboxed before the comparison."

Wouldn't that mean that since they are both 2 they will point to the same reference variable making the == between them true?
Sorry the last portion is from teh exam...they say the answer is a 0 0 3 0. I thought it should be runtime exception...
Integer Ithree = new Integer(2); // 1
Integer Ifour = new Integer(2); // 2
System.out.println( Ithree == Ifour );

wouldn't they unbox and 2 == 2?
Can someone explain this for me:

int []arr = {1,2,3,4};
for ( int i : arr )
{
arr[i] = 0;
}
for ( int i : arr )
{
System.out.println(i);
}

The options:
A Prints 0 0 3 0
B Prints 0 1 2 3
C Prints 0 0 0 0
D Runtime Exception Occurs
E Prints 0 2 0 0
F Compile error
-----------The exam says---
The correct answer is A.
This so happens because arr[3] was made 0 during an iteration of the first "for in loop". So during the final iteration of the first ��for in loop�� , we have 0 instead of 4 in the last index. It can be seen from the second loop why an ArrayIndexOutOfBoundsException was not thrown at runtime. The maximum number in the array is 3 which does not exceed the bound of the loop.

-------

I think it should be: "D" - Runtime exception (ArrayIndexOutofBound)

because it would loop throw all int values 1,2,3,4 and set the corresponding index of those numbers to 0 then I would think it would do soemthing like this---
so before first loop:
@Index / int value
0 / 1
1 / 2
2 / 3
3 / 4

After first loop
0 / 1 (since for (int i:array) -- first value is 1 so it would set the index 1's value not index 0)
1 / 0
2 / 0
3 / 0
then it will try to access array index on 4, which isn't there?
I don't understand the answer:
[ March 10, 2007: Message edited by: Ben Harrison ]
Can someone please explain the Bingo Bango Bongo exam question? I have to find it again, but if someone has run into it, I'd appreciate it:

Basically it has 3 classes bingo,bango, bongo and then you have to pick which ones are correct. I'll post the question if I get it again, it'll just be a pain to type up. Thanks