el daniel

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

Recent posts by el daniel

I passed the exam yesterday.
I would like to share my experience...
First of all, i would like to say that my objective was not only to get the certification but to learn as well as possible the concept of java programming.
So I worked hardly, about 6 months,also in topics that were not covered on the exam objectives) and get (i think) a deep knowledge of java programming.
The exam was not as though as i expected, maybe because i was well prepared.
I get several mock exams on the net (mocks exams on the javaRanch list), but i used mainly dan chisholm web site (thanks Dan). If you go through his website, you will learn a lot about java programming and become well prepared (i mean high scrore!) for the certification. Some questions are challenging and, as a rule, more difficult than the real things.
Thanks also to all JavaRanchers who give me several times explanations and answers about very tricky questions...
So my advise is: don't focus about certification, enjoy learning experience. Success will come by itself.
my next step ? spend more time with my lonely wife :-)
el daniel
SCJP2
21 years ago
thanks,
if i understand well, the value of a local and class member variable aVar ( consider int aVar=1 ) is known @runtime and not @compile time?
thank you
[ January 31, 2003: Message edited by: el daniel ]
[ January 31, 2003: Message edited by: el daniel ]
I've got a problem with compile time constant expression.
There are several places in which we need them, for example they are used in case labels in switch statements....
first consider this example:

According to JLS rules ,(n==2) is not
considered to be a compile time constant expression, although "n" is known @ compile time. hence a compile time error occurs.
To fix the problem, we can do this,for example:

the if() statement is now a compile time constant expression.
But WHY the example below doesn't work?

[ Jess added UBB [code] tags to preserve whitespace, check 'em out! ]
[ January 31, 2003: Message edited by: Jessica Sant ]
Hi,
I found this little code based on String.
The are no problems for 1,2, 3,4 but i wonder about the 5!
I thought that Strings litteral were managed in a pool by the class in which they were compiled! In that case 5 would be false as the string litteral " i am unique " belong to different class. But this theory doesn't seem to be correct:-(
So can anybody help me?
public class MyClass{
static String s1 = "I am unique!";
public static void main(String args[]){
String s2 = "I am unique!";
String s3 = new String(s1);
System.out.println(s1 == s2);//1true
System.out.println(s1.equals(s2));//2true
System.out.println(s3 == s1);//3false
System.out.println(s3.equals(s1));//4true
System.out.println(TestClass.s4 == s1);//5true
}
}
class TestClass
{
static String s4 = "I am unique!";
}
Hi,
Can somebody explain how to assign a char variable with the simple quote (') using the unicode character \u0027 and escape character \,in order to reach the same value of c1?
char c1='\''; //OK
char c2='\u005c\u0027'; /* OK-> like c1 */
char c3='\'\u0027; //OK ->like c1 and c2
My idee was:
char c4='\\u0027'; //doesn't compile
Hi,
I pick up this question from Dan Chisholm mock exam.(topics exam/type conversion/exams B/q4)
What is the result of attempting to compile and run the above program?
import java.io.Serializable;
1. class Blue {
2. public static void main (String args[]) {
3. int[] i = {1,2,3};
4. Serializable s = i;
5. i = (int [])s;
6. }
7. }
line 4 is fine: array can be converted to Object type,interface Serializable or Cloneable.
But i thought that (line 5), at compile time, "s" refer still to a Serialisable interface type and i didn't find anywhere that it is allowed to cast an interface to an array type (@compile time)