Brett Friend

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

Recent posts by Brett Friend

Hello Ranchers,


In this code:

final int a = 1;
final int b;
b = 2;
int x = 0;
switch(x) {

case a: // No error here
case b: // Here, I get a compiler error "case expressions must be constant expressions."

}


Interestingly, if i replace
final int b;
b = 2;

by
final int b = 2;

the code compiles.


Whats the difference between the two approaches??



Thank you.




Yes, Glank has a Jooker and Jooker has a Bostron. So Glank has a Bostron.

Just as indirect IS-A relationships exist (Superclass - subclass - subsubclass), indirect HAS-A relationships can exist too.



So, A D F are correct. B E are not.
Hey Hama!

I am not sure what your question is. Are you trying to assign 2 to y? Line 6 in your code won't work.

y is a local variable of method tryIt(). It is declared final. And y is already assigned value 1 through the method call.

So y = 1. And that's final! You cannot reassign 2 to y.


If line 6 is kept commented, your code compiles just fine!


HTH,

Brett
Hello All,

I had some questions regarding Exam registration process:

1. Do college students get any discount on the exam fee? I didn't find any information about this on the oracle site.

2. Whats the difference between buying a voucher and registering directly through Pearson site? And which one is better/cheaper?


Please explain!! Thank you!!

Thanks Faraz!
Hi All,

It takes about 4 - 6 weeks to receive your SCJP certificate by mail after clearing the exam. Can I appear for SCWCD before actually receiving the SCJP certificate by mail?


Thanks!