Jason Kim

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

Recent posts by Jason Kim

Cleared SCJP 5 yesterday with 91%.

Thanks guys.

This forum and JavaRanch site have been very helpful and useful.

Just a personal opinion, the actual exam was a bit easier than I expected. May even be a bit disappointing..

However, I have gained a lot of knowledge during the preparation period and
hence I feel the whole experience was worthwhile.

Thanks again JavaRanch and Ranchers..

Originally posted by Sarikaa Bhatnagar:
HI,

this is exactly what i understand and this is what is causing confusion.
When a copy of array is passed to f() then i believe there are totol 5 objects.

Please explain!



Sorry maybe I wasn't clear enough.

The whole array does NOT get copied across. It's only a reference variable
that is getting copied. So there is only ever one array existing and this is created in main().



The array variable arrayVar is only a reference or handle to the
array object. The variable contains some sort of
address that identifies where the actual array exist in memory.

Hope this helps.
I will give a try but I could be wrong..




First of all, array is Object type as in it satisfies IS-A relationship with Object.

line 1 compiles because of above fact.

line 2 works because books is array of int arrays and each int array
is of Object type. Hence it can be array of Objects.

line 3 doesn't work because books is array of int arrays and TwoDPrimArray
is array of Object arrays. int and Object are not type compatible.


If books was 3-D int array. line 3 would have worked.
And line 4 wouldn't compile.



Hope this helps.
That's because Java is 'pass-by-value' NOT 'pass-by-reference'.

When array variable main() is passed into method f(), a new local array variable is created. They point to same array but are two different reference variables.

Hence doing array = null in f() will only change what local array variable points to and does not change the array variable in main().

Hope this helps.

Originally posted by Tony Smith:
If you don't already have a good idea on whether you are going to pass it or not, it's better you reschedule it. Don't waste your money. Have you been studying hard for at least few months?



I have been reading K&B book for last 3 months but haven't had many practices with mock exams.

That's why I am concerned. I know people have been saying that you should get well above the pass mark with mock exams in order to be sure.

So by how much ?

"Is the actual exam harder and trickier than mock exams?" is my question...
Hi,

I am taking the exam in 10 days and getting worried.

1. How hard is the exam compared to following mock exams ?

- Java Inquisition

- K&B Qs

- Marcus Green

Basically I have been practicing these but I find haven't doing well with the Qs from Inquisition and some of K&B. I feel there are quite tricky, especially the ones from Inquisition
Should I expect the actual to be harder and trickier than this ?



2. Just out of curiosity does anyone have any idea on general pass rate ?
[ October 10, 2007: Message edited by: Jason Kim ]
Can somebody help me with question...


class Eggs {
int doX(Long x, Long y) { return 1; }
int doX(long... x) { return 2; }
int doX(Integer x, Integer y) { return 3; }
int doX(Number n, Number m) { return 4; }

public static void main(String[] args) {
new Eggs().go();
}
void go() {
short s = 7;
System.out.print(doX(s,s) + " "); // line 1
System.out.println(doX(7,7)); // line 2
}
}

What is the result?

A). 1 1
B). 2 1
C). 3 1
D). 4 1
E). 1 3
F). 2 3
G). 3 3
H). 4 3

Answer: H) which prints "4 3"


I am puzzled about the first print statement in line 1.

My thought was that it would print 2 because it will widen and then
use var-args as widening beats everything else.

Why does boxing-and-then-widening takes priority over
widening-and-then-var-args ?

Originally posted by dave natx:
Hi Mary,

I believe the issue is literal integers are always implicitly ints so to call a byte constructor with a literal int you would need to explicitly cast it: this((byte)4);

Thanks,

Dave



Hi dave,

I am confused and need some help in understanding this.

It is true that literal integers are always implicitly int.

However, AFAIK, a literal integer such as 4 should be implicitly casted into byte which can take upto 2^7-1 = 127.

eg/
byte var = 4; // this works without explicit cast

I thought explicit cast is only required when you are trying to assign
bigger value into smaller container.

Is this incorrect for invoking overloaded constructors/methods ?
Does anyone know where I can get Open Source/Free Document Management System to include in WebSphere Portal Server ?
Maybe as a WAR or WebSerice ?
21 years ago
Hi.
Can anyone tell me which version of CVS for Linux is supported by WSAD V5 ?
Thanks in advance.
21 years ago
Servlet in different applications within same virtual host can call each other.
ServletContext context = getServletContext('context-root-name');
context.getRequestDispatcher('uri-of-servlet-to-be-called').forward(request,response);
If applications are in different host, one has to use URL connection or sendRedirect ?
21 years ago
Hi.
Can a servlet load another servlet in different J2EE application ?
If so, could you show me how ?
Code example would be much appreicated.
Thanks.
21 years ago
Hi.
Can a servlet load another servlet in different J2EE application ?
If so, could you show me how ?
Code example would be much appreicated.
Thanks.
21 years ago
Hi.
I am a newbie in J2EE using WebSphere V5.
While migrating an EJB application from WebSphere V3.5 to WebSphere V5, I came across "javax.naming.Context.PROVIDER_URL".
In WebSphere V3.5, it seems that it is used to resolve JNDI name for EJB or to locate home interface of the EJB.
Am I correct ?
However, in WebSphere V5, it causes an NamingException and the application only works without it.
So can I just leave it out and safely assume that
WebSphere V5 doesn't require "javax.naming.Context.PROVIDER_URL" ?
21 years ago
Hi.
I am a newbie in J2EE using WebSphere V5.
While migrating an EJB application from WebSphere V3.5 to WebSphere V5, I came across "javax.naming.Context.PROVIDER_URL".
In WebSphere V3.5, it seems that it is used to resolve JNDI name for EJB or to locate home interface of the EJB.
Am I correct ?
However, in WebSphere V5, it causes an NamingException and the application only works without it.
So can I just leave it out and safely assume that
WebSphere V5 doesn't require "javax.naming.Context.PROVIDER_URL" ?